Welcome, Guest.
Username: Password: Remember me

TOPIC: distortion correction - conformal perspective

distortion correction - conformal perspective 1 year 6 months ago #41

Quick question, lets say I have a curved screen, do I still need this shared to correct perspective?
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 6 months ago #42

WSH303 wrote:
Quick question, lets say I have a curved screen, do I still need this shared to correct perspective?
Try if it works for you :cheer:
But technically speaking Yes. More curved the display, more spatial sensation this perspective would give.
Like in this example:


To be correct, if projector would be behind your seat (like in that arcade) stereographic perspective is the right one for dome screen. This is extreme example. It gives VR-like experience.
Last Edit: 1 year 6 months ago by Fu-Bama.
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 6 months ago #43

Martigen wrote:
brussell wrote:
Martigen wrote:
Does it handle multiple 'huds' - i.e difference between a main menu or an in-game inventory? I imagine it depends on the layout of the hud and recognised pixels.
Yes. In short: HudDetected == (Hud1Pixel1 && Hud1Pixel2) || (Hud2Pixel1 && Hud2Pixel2 && Hud2Pixel3 && ...) || ...
Nice! Where's the shader? :)

Soon. Next week.
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 6 months ago #44

Hello,
I just yesterday have found huge bug in perspective transformation formula. The perspective which this shader produce is not quite stereographic projection, but still much better than standard linear. Objects at the borders still get distorted, more noticeably in FOV higher than 100 degrees.
The issue is that I based the code on inverted vertex shader that transforms linear projection to stereographic, but pixel UV shaders are not transformational, but look up. Idea can get confusing :P :huh: . Basically they work the other way around. Its like a glass lens in front of a linear picture, but instead of multiplying the image by lens distortion, you have to go from the viewer eye, through "the lens" and guess where the "ray" hits the picture, as it's look-up based. And it's more complicated than I thought.
But I have good news too. I managed to make new formula that thankfully creates correct distortion correction. But there are still some things to invent.
Like simple UV scaling, for borders management, changes the distortion, because it's look up, not transform.
So tomorrow I will post the geometrical model scheme with detail, and maybe someone will be able to give some help :oops:
But hopefully I will be able to figure things out in coming days.
The administrator has disabled public write access.
The following user(s) said Thank You: MaxG3D, Scorpio82CO

distortion correction - conformal perspective 1 year 6 months ago #45

To introduce things out.
Space can be represented by a sphere, like a Google Street View, where 360 degree image is wrapped on a sphere and seen form inside.
To grab a portion of 3D space (sphere) and display it on a flat surface, like a monitor we have to map its coordinates on flat UV space.
Basically whole topic of map projections is about displaying sphere (world map) or its portion (e.g. city map) on a flat plane.
What we want to achieve here is mapping scaled Stereographic screen coordinates onto Linear image coordinates, since we are using game-texture UV-space lookup.
It has to be scaled at first since we want to adjust the borders size, and scaling (zooming) will change Stereographic screen FOV at the borders of the image.
Simple UV multiply changes the distortion.

Linear projection in cartography is Gnomonic projection.
And difference between linear projection and stereographic projection is simple point of view.
Linear projection looks from the center of the sphere:


Stereographic projection looks from the surface of the sphere:


Drawing shows flat view from above on the camera frustum.

Even doe it's 2D shader, we operate in 3D space and
only things that we know is UV position of current pixel being processed and in-game camera FOV which user enters in shader settings. That's 2D data, UV = XY, to get the third component Z (XYZ) we can use cotangent of 1/4 FOV.

To get the linear pixel coordinates, we "project" the point onto a sphere surface, then we "look at it" from the sphere center and finally we scale it down to the crosing of the image plane (projection plane).
Now if we scale (zoom) the final image, we also need to scale the Z component, or C component.
The [?=x'/x] is the thing by which we multiply the radial UV coordinates of the game texture.

One can ask, "if it's all cartography, why won't we use already existing formulas!" Well, they're all based on latitude and longitude coordinates which require a lot of trigonometry. We want to avoid that.
It's manageable through similar triangles, etc.
I haven't figure everything out yet, but I'll try. Optimistically I will be able to get new formula in few days, but if you do it faster, feel free.
The administrator has disabled public write access.
The following user(s) said Thank You: MaxG3D

distortion correction - conformal perspective 1 year 6 months ago #46

Ok, I was able to get new formula for UV distortion.
But some things don't work, maybe somebody can give advice.

Things that work:
  • It shows proper stereographic projection. :lol:
  • You can choose between horizontal, diagonal and vertical FOV
  • Manual zooming without deformation :silly:
Issues:
  • Changing FOV type, changes distortion alignment, making automatic zoom a problem :silly:
Things that don't work:
  • Automatic zooming action to adjust borders
Beta code:
Warning: Spoiler! [ Click to expand ]
Last Edit: 1 year 6 months ago by Fu-Bama.
The administrator has disabled public write access.
The following user(s) said Thank You: MaxG3D

distortion correction - conformal perspective 1 year 6 months ago #47

I updated the shader with new formula. You can download it from the official package.
It seems that manual zooming is better in some cases, like some games use letter-boxing.
Also anti-aliasing works better when you zoom-out the image few pixels.
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 5 months ago #48

Amazing shader, this had make triple display gaming amazing as it can counter the famous fish eye effect
The administrator has disabled public write access.
The following user(s) said Thank You: Fu-Bama

distortion correction - conformal perspective 1 year 5 months ago #49

I'm absolutely loving the effect that this shader had in most of my games while playing in a triple monitor setup, it almost disables the famous "triple screen fish eye effect" perception , but the problem is that the section in the center of the screen (the central monitor) looks a little pixellated and the visibility gets reduced as this section gets "zoomed in".

Would it be possible to add a slider to lower the effect intensity linearly from the edges to the center of the screen, in a way that we can keep the same intensity of the effect near the screen edges, but lower the effect intensity near the screen center.
Last Edit: 1 year 5 months ago by Nanoxo.
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 5 months ago #50

Nanoxo wrote:
I'm absolutely loving the effect that this shader had in most of my games while playing in a triple monitor setup, it almost disables the famous "triple screen fish eye effect" perception , but the problem is that the section in the center of the screen (the central monitor) looks a little pixellated and the visibility gets reduced as this section gets "zoomed in".

Would it be possible to add a slider to lower the effect intensity linearly from the edges to the center of the screen, in a way that we can keep the same intensity of the effect near the screen edges, but lower the effect intensity near the screen center.

Zooming is unavoidable, as it is what linear perspective does.
It stretches center of the screen towards infinity when near 180 FOV.
Warning: Spoiler! [ Click to expand ]

Warning: Spoiler! [ Click to expand ]


It is possible to zoom out the center screen, but its borders won't be matching with the wing screens.
You would see 2x same things on the center and side monitors.
(...)
Last Edit: 1 year 5 months ago by Fu-Bama.
The administrator has disabled public write access.
The following user(s) said Thank You: turgor128

distortion correction - conformal perspective 1 year 5 months ago #51

(...)
The pixelation comes from that. Even VR googles have to deal with it.
For example HTC vive renders game graphics internally at 140% resolution of the display, to compensate for the pixelation - this is one of the reasons why VR games run so slow.



(...)
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 5 months ago #52

(...)
Let's go deeper ;) using the occasion

Human can see 180° FOV or more,
we are definitely not using the linear perspective :) .


We even see the colors at different FOVs


And check this out:

Source: NASA - Chandra X-Ray Observatory

Cool right?
Last Edit: 1 year 5 months ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: SandyCheeks

distortion correction - conformal perspective 1 year 5 months ago #53

Is the precise data from the second diagram available somewhere? Would make for an interesting colored vignette filter. Is the the measured difference unidirectional or is it different in top/bottom/left/right?

EDIT: Voldemort's binocular vision cone is broader ;) no nose blocking the view
Last Edit: 1 year 5 months ago by Marty McFly.
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 5 months ago #54

Marty McFly wrote:
Is the precise data from the second diagram available somewhere? Would make for an interesting colored vignette filter. Is the the measured difference unidirectional or is it different in top/bottom/left/right?

EDIT: Voldemort's binocular vision cone is broader ;) no nose blocking the view

Here's the source of the second diagram vr-lens-lab.com/field-of-view-for-virtual-reality-headsets/
Vignette filter like that would be cool. I think YUV space is most human-like. Should be easy to work it out in that space. :)
In VR, when there's no stationary thing in view, like nose, you get nausea. I wonder if he got some :D

...This thing would be perfect www.roadtovr.com/nvidia-perceptually-bas...-rendering-research/
if it was available in nvidia control panel
Last Edit: 1 year 5 months ago by Fu-Bama.
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 5 months ago #55

Tojkar wrote:
(...) I love the old lo-fi monitors, which curves the picture due to their physical properties, but I equally hate the black borders and corners.
I was trying to modify some existing shaders which has the fisheye effect included, but I never managed to succeed. That being said... (...)
I just updated the PerfectPerspective.fx to version 2.1.2 which addresses the borders issue.
It now features texture mirroring, Borders Color now has Alpha channel which blends the borders color with the borders image.



Mirroring borders ON (default) with some color tint works best for motion picture.
Mirroring OFF displays original image at the borders and works nice for screenshoots.

Warning: Spoiler! [ Click to expand ]

Warning: Spoiler! [ Click to expand ]


When borders are visible only at the corners, Mirroring ON and Alpha at Zero fixes that.

You can download the updated shader from the official package at github.com/crosire/reshade-shaders
Last Edit: 1 year 5 months ago by Fu-Bama.
The administrator has disabled public write access.
The following user(s) said Thank You: Tojkar, Rudy102

distortion correction - conformal perspective 1 year 5 months ago #56

New update 2.2.1 has been added to the shader repository. github.com/crosire/reshade-shaders

It adds new feature, a vertical distortion amount slider. You can adjust how much vertical lines, like buildings, are distorted.
0 - shows cylindrical stereographic projection
1 - spherical stereographic projection (old behavior)
By default it's set to 0.618 which seems to look nice.

Images:
Warning: Spoiler! [ Click to expand ]
The administrator has disabled public write access.

distortion correction - conformal perspective 1 year 3 months ago #57

Just released update 2.2.6 adds new ui_category feature from ReShade 3.2.2 and anti-aliasing of image borders.
Available here github.com/crosire/reshade-shaders
The administrator has disabled public write access.
The following user(s) said Thank You: Wicked Sick

distortion correction - conformal perspective 1 year 3 months ago #58

Fu-Bama wrote:
Just released update 2.2.6 adds new ui_category feature from ReShade 3.2.2 and anti-aliasing of image borders.
Available here github.com/crosire/reshade-shaders
Thank you! I use this all the time with Natural Selection 2 :)
The administrator has disabled public write access.

distortion correction - conformal perspective 10 months 2 weeks ago #59

Changed the shader a bit. Now there is no barrel distortion, the choice of the type of FOV works correctly ...
Try and write good or bad.

drive.google.com/open?id=1pRzO5U-NDB1yI8ht3raOjd6nDur_AHTK

https://photos.app.goo.gl/qsQ5Ke5Vq4rweDgz8

https://photos.app.goo.gl/UN75htGqtUFsQDdL9
Last Edit: 10 months 2 weeks ago by ZapaL.
The administrator has disabled public write access.
The following user(s) said Thank You: Wicked Sick, Sinclair, turgor128, Mr. Smiley

distortion correction - conformal perspective 4 months 5 days ago #60

I've been using this shader and it definitely makes playing some games a bit better, but I have an idea I would love to try out with this. Would it be possible to apply a sort of double circle effect magnification? Instead of perfect circles, make it two intersecting ellipticals that are angled towards a center point, and only apply magnification to things inside the ellipticals without touching the edges. This thought occurred to me after looking through this one project on github about field of view, and I was thinking how can someone apply a similar concept to a shader.

This is the project I was referring to: github.com/shaunlebron/blinky
The administrator has disabled public write access.