• 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
Question by drudiverse · Jul 24, 2014 at 02:03 AM · cameradistanceplaneviewclip

largest reasonable camera view distance?

What is the largest far clip plane that could be feasable for a game, prior to getting some kinds of bugs with camea view? i.e. a giant spacecraft on long distance terrain, 28 000 view distance is too much?

Comment

People who like this

0 Show 0
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

  • Sort: 
avatar image
Best Answer

Answer by Eric5h5 · Jul 24, 2014 at 02:42 AM

It depends on what you're doing exactly, but normally 28K is way too large and can result in zbuffer precision issues. Typically 1-2K is the most you'd want to use. You can use techniques such as more than one camera to deal with long view distances.

Comment
drudiverse

People who like this

1 Show 2 · 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 drudiverse · Jul 24, 2014 at 07:14 AM 0
Share

Thanks. You would change between a long range and a short range camera depending on view distance? Is that equivalent to changing the clip plane variable on the camera?

It sounds as if the screen could be devided into squares, and distance within the squares could be checked so that each one is rendered with a camera of the corresponding clip plane? :)

avatar image Max_Bol drudiverse · Aug 07, 2016 at 05:32 PM 0
Share

I know this has been a while (over 2 years), but as one of the first result on Google where searching for long range view in Unity, I think an answer should be given here.

There's 2 "layers" to consider to build a long-range view system in Unity.

The first layer is whenever an object is close enough to be seen and interacted in the view. This is controlled with the LOD system and doesn't requires much scripting if any depending on what you wish to do. There's the documentation (well, the beginning of it) : https://docs.unity3d.com/Manual/LevelOfDetail.html

The second layer is more complex as its used to overcome what Eric5h5 explained which is Zbuffer precision issues (or also known as float precision issues) as positions are calculated via floats which are always 32bits values and, in computing, 32bits values equals up to 7 digits (regardless of the decimal position) so between either 9999999 and 0,000001.

Floats precision issues is related to the ability for a computer algorithm to not double check the last 2 or 3 last digits of a 32 bits data when it's set as not important. This means that if you use a float that is 9999999, the computer can interpret it as anything between 9999999 and 9999900 (and, if the memory is lacking which is not rare during memory spikes in video games, even down to 99999000!) If you ever wondered why the position or rotation of an object in unity seems to not be a perfect number like if you put 5 and it always become 4.999472... that's an example and it's can be avoided by switching the value to a pure number unrelated to both the imprecise and wanted result (so switching to 8, then 5 will reset the imprecision).

But, as you might have guessed, doing this in UI and in scripts is different.

So, the trick in video games to allow displaying huge worlds is to create and display 2x the same worlds at different sizes and rendering them both at the same time in the right order.

So, in other words, you got 1 HUGE detailed world that is only rendered at up to 1-2k in distance. Then again, if you wish to avoid precision issues with the positioning, you would have to consider the concept of zeroing the camera's target position (or the ship/whatever the camera is looking at) so... instead of moving the ship/character inside an "universe", you're moving the universe around the object that is focused on by the camera. Then you use a 2nd camera with a different movement speed that only see long range low level stuff (like planets, suns, etc.) and not the close stuff.

You make sure both camera are in the right order of rendering : Render the fake long range camera first, then the high detailed short range camera over with Only Depth activated (and no skybox on the short range one). If you set the things right, it will display long and short range stuff correctly.

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

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

Related Questions

camera view grass distance 1 Answer

How to pan-rotate camera transform parallel to its view plane? 1 Answer

Showing what the Camera sees on a plane 1 Answer

Distance gameobject to camera edge 1 Answer

WebCamTexture zoomed in on iPad Pro 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