Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by tiltaghe · Mar 06, 2013 at 12:46 AM · camerafogperspectivedistortion

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.

alt text

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 :)

project_example.png (265.8 kB)
Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kramcomposer · Mar 06, 2013 at 01:31 AM 0
Share

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

avatar image hoy_smallfry · Mar 06, 2013 at 04:31 AM 1
Share

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

avatar image Graham-Dunnett ♦♦ · Mar 06, 2013 at 12:54 PM 1
Share

How about applying some vignetting to darken the edges of the screen?

avatar image tiltaghe · Mar 06, 2013 at 03:08 PM 0
Share

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

avatar image hoy_smallfry · Mar 06, 2013 at 04:49 PM 0
Share

I've revised my comment, with A LIN$$anonymous$$!

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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

Sphere turns oval at edge of viewport 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges