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 Lovrenc · Sep 22, 2013 at 05:56 PM · terrainrenderingz-depth

Terrain / "water" texture depth/rendering problem

Hello,

I made simple flat terrain with river. I added filler texture and i have encountered some graphical issues (it is same if i use simple unity water). I appended 2 images. Left is game view and right is scene view (issue appears identically in both views).

If camera is directly above terrain (looking down), everything looks ok (though, when i sam moving camera vertically, water is fluctuating up and down). (Scene view is not directly top down, you can already see rough edges).

alt text

When i add some angle to camera, everything looks broken, unless i am certain distance from the terrain.

alt text

How does Unity decide? What is wrong here?

terrain 1.jpg (251.0 kB)
terrain 2.jpg (206.4 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Hoeloe · Sep 26, 2013 at 07:23 AM

This is because of floating point arithmetic. Any non-integer value tends to be floating point, which is very inaccurate. As you get further away from these objects, the visible distance between them becomes less, and errors crop up in the z-buffer. Transparent objects are particularly prone to sorting errors too, since they can't be directly written into the z-buffer. As for how to fix it, you can reduce the clipping range of your camera - either increase the near clipping plane, or decrease the far one. This shorter range allows for the z-buffer to keep more accurate depth values after projection, so you don't get the same artefacts.

Comment
Add comment · Show 4 · Share
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 Lovrenc · Sep 26, 2013 at 05:57 PM 0
Share

I already ditched this in the process, but had same problem with vanishing objects when zoo$$anonymous$$g map out. This helped to some extend, my object never vanishes anymore while zoo$$anonymous$$g out to my "max out" limit. Still have terrible "see trough part of object" problems, but i guess my mesh is really poorly made etc.

Thank you.

avatar image Hoeloe · Sep 26, 2013 at 06:06 PM 0
Share

You'll never avoid this effect completely - the best thing you can do is to configure it so that it never (or at least rarely) happens within the scope of your game.

avatar image Lovrenc · Sep 26, 2013 at 06:14 PM 0
Share

Ofcourse, there is only that many floating point numbers you can represent with 32 bits (or are unity floats 64bit? dont know), but with some smart modeling i can reduce this a lot. $$anonymous$$y model at the moment is at some points really really thin and it doesent need to be so.

There is so many problems once you go past simple old games clones :D

avatar image Hoeloe · Sep 26, 2013 at 07:24 PM 0
Share

Unity's floats are just regular floats - 32-bit ones. Unity doesn't use its own representation of floating point values. You can create a 64-bit one using the double type, but most of Unity's variables are 32-bit.

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

16 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 avatar image avatar image

Related Questions

renderning quality on far away objects 2 Answers

Unity terrain trees dispear in front of me way to fast 1 Answer

Unity terrain grass extremely weird 0 Answers

Unity terrain and odd frustum culling behavior 0 Answers

quad vs plane as terrain 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