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 Jusas · Sep 29, 2013 at 04:59 PM · scenescaleprecisionfloatingpoint

Scene scale and float precision

I've been struggling with this question for a while now.

I have a big issue with scaling. My world, which mainly just consists of simply "dead" terrain is large, in real life scale we're talking about 1000km x 1000km. In that world I have aircraft, which are the size of around 10-20 meters. Now you can imagine what the problem is, there's a huge scale difference between the world and the smallest objects. While a missile might be 2 meters long, the world is 1 000 000 meters long... and no matter how you put it, downscale it by 10, 100 or 1000 the scale difference is still there and causes serious jittering when I zoom in to the small objects.

So I'm puzzled now, how do I implement the large world without the jittering problem?

Comment
Add comment · Show 6
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 Hoeloe · Sep 29, 2013 at 05:14 PM 0
Share

I think the issue might be to do with your huge terrain. Unity won't be able to cull it properly if any of it is onscreen, so you're still calculating with an essentially massive object. If you disable your terrain, then zoom in, does the jitter still occur? If it doesn't, then you might want to look into breaking your terrain up into smaller "chunks", using several terrain objects, allowing Unity to only render the chunks that are currently in view.

avatar image Professor Snake · Sep 29, 2013 at 06:20 PM 0
Share

The jittering is most likely due to Z-Fighting. Unfortunately, there's not many ways of solving this besides increasing your camera's near clip plane to increase the depth buffer precision and giving a depth offset to those smaller objects via a shader.

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

This depends whether by "jittering" he means that the game slows down erratically, or that the objects "flicker". If the former, then my suggestion is likely correct, if the latter, then it is z-fighting.

avatar image Professor Snake · Sep 29, 2013 at 06:31 PM 0
Share

If it were the former, zoo$$anonymous$$g in would cause the game to run faster since a lower field of view would mean less things to draw. I'm also pretty sure that the built-in terrain is capable of chunk-based culling on its own.

avatar image Jusas · Sep 29, 2013 at 07:35 PM 0
Share

This is not actually z-fighting - it's about objects moving and getting rendered inaccurately and jittery motion. I did some more research and it appears the problem appears when the distances increase, ie. when we move further away from the (0,0,0) origin. It's about not being possible to render high float values accurately due to the nature of floating point numbers - the bigger the number, the less accurate it gets.

It seems that the Floating Origin technique is one solution. $$anonymous$$eeping the camera at the origin while moving the scene around makes sure that we never handle high floats near the camera. I will have to try that approach.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by reefwirrax · Sep 30, 2013 at 08:01 AM

float-based inaccuracies start after 99,000 units according to unity, and they become a noticeable issue after about hundred and 50 or 200,000 units, and beyond 500,000 units the textures and vertices are completely nonsense.

if you are making anything in unity more than 100,000 units, then you are overloading the floating points. it still takes 20 min to fly that far 300 km/h. any objects more than 99,000 from origin should generate a warning in the inspector.

Comment
Add comment · 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

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

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

Related Questions

Obtaining a proper scale. 1 Answer

Custom World Coordinate system? Changing Space.World? 2 Answers

Scene is suddenly super small,Scene is suddenly super small on reload 1 Answer

Networking with cells 0 Answers

Interface Map 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