Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 JtheSpaceC · May 16, 2016 at 10:46 AM · camerascaledistanceclipping plane

Large scales, increased clipping planes, and performance

The standard clipping planes on the camera are 0.3 and 1000, near and far. I'm experimenting with parallax vs real perspective movement in a space game.

In my 2D game 1 Unity unit/meter is 10 real world units, but I want to get nearby planets and backgrounds to move appropriately in the background as the player moves in X and Y.

One thing I'm trying is using a perspective camera and putting a sprite of a planet WAAY into the background and enlarging its scale. Scale = 50 and Z distance is 9000 currently. This is giving me a 10km diameter planet (.063% Earth-size approx) 90km away, according to my game's own relative scale. That size is workable for a game, but I wonder about having something bigger further in the background.

To do just this little I had to set the camera far clipping planes to 10,000 instead of 1,000. I'd like to go even x10 bigger than this again, so x100 times normal clipping distances, scales, and game distances.

Will those kind of numbers be doing terrible things to the performance I'm wondering, or is a couple of extra zeros no big deal to the engine? Worth noting that there's no physics or colliders on the enlarged planets.

Comment
Add comment · Show 1
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 elenzil · May 16, 2016 at 11:48 PM 1
Share

don't forget that the distance of your near-clip plane to the camera is a huge factor in the precision of your z-buffer. it's extremely non-linear. if you start to see "$$anonymous$$ring", where two polygons that are close together in distance seem to be "fighting" for which one is in front, try increasing your near clip-plane. generally you want your near clip to be as far away as possible without bumping into geometry.

1 Reply

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

Answer by _Yash_ · May 16, 2016 at 11:40 AM

If increasing far clip plane is not adding new objects in view than it is not changing performance. But in the other case if increasing far clip plane adds a new object in the scene it will affect the performance. The camera uses Occlusion culling which allows the engine to discard anything far away from far clipping plane. It is an optimization technique used for very large maps. In your case, I guess there is no change in the number of objects being drawn when you increase the far clip plane hence no change in performance.

Comment
Add comment · Show 3 · 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 JtheSpaceC · May 16, 2016 at 12:30 PM 0
Share

Thank you. Yes the only new objects are a planet or two that I put right in the background, and they're just large sprites. Do you know if the scale would cause problems? Like 5000 in the x and y?

avatar image _Yash_ JtheSpaceC · May 17, 2016 at 12:05 PM 0
Share

No scale would not cause any problem. But it can be serious problem if any how it is being used as physics object (has rigidbody) because physics calculates everything in 1 meter = 1 unity scale.

avatar image _Yash_ JtheSpaceC · May 17, 2016 at 12:09 PM 0
Share

also consider what @elenzil said, it can be solved by keeping near clip plan as far as possible.

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

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

Related Questions

Unrealistic size of sun, viewed from earth 2 Answers

Camera position 1 Answer

Auto Scale camera depending on Screen Size - How?? 3 Answers

Show squares in the camera 0 Answers

Multiple cameras, foreground strangely obscured, clip distance 0 Answers


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