- Home /
Perspective distortion makes objects on the edges of the screen "nearer"
Hi :)
The perspective of the camera creates a distorsion that makes the objects on the edges of the screen to appear nearer, bigger. I wonder if there is a workaround for what is an issue to me as it affects gameplay, especially vision within the night fog. See the example below where I rotate the camera from the same position.
My FOV is 70, but even with a narrow 40 FOV the problem still exists, allowing the player to "edge cheat" through the fog and see information that he souldn't know (design-wise)
I use a linear fog, but the exponential ones produce the same effect if I recall correctly. thank you for any clues or workarounds :)
i'm pretty sure this is actually a problem with how games render, since you can "edge cheat" in alot of games with fog, but I could be wrong
I think I would second what @kramcomposer said. You're getting this behavior because of how the graphics pipeline transforms vertices for rendering. It does not render meshes in world coordinates; ins$$anonymous$$d it maps it to camera coordinates, then to what's commonly referred as Normalized Device coordinates. These coordinates can be visualized as the camera frustum and transformed into a unit cube, like this visualizes. This is done so that it can then easily be drawn to a screen. Notice those images in the link: when the frustum gets shaped into the cube, everything "far away" (like the $$anonymous$$pot nose) gets shrunk, just like our eyes see things farther away shrink!
So, by the time we get to the fragment shader, all idea of "world coordinates and the distances of things in the world is gone. The farthest depth then becomes 1, and the nearest depth 0. Anything past those ranges is what you see clipping out.
$$anonymous$$ost fog shaders are based off of the depth buffer, not the actual geometry, and the values in the depth buffer are in a range of 0 to 1, which is analogous to NDC space.
I suggest that you change the value of the fog (if you can) in some proportion to changing the FOV
How about applying some vignetting to darken the edges of the screen?
thanks! Vignetting won't really apply to my project, plus i use unity free version, but thanks for pointing it Graham. It could be another approach.
thanks kram and jbarba, it makes sense and gives me a better understanding of the rendering pipeline of the engine. $$anonymous$$aybe I can create a custom pre-fog with particles that is based on distance/geometry
Your answer
Follow this Question
Related Questions
Camera FoV and Scene Geometry Distortion 1 Answer
Orthographic position to Perspective position 0 Answers
Camera Bounds 2 Answers
How to do perspective camera zoom? 1 Answer