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 magarcias · Jun 02, 2011 at 03:32 PM · cameracullingclipping

How to use two cameras, one for culling one for rendering

This might be an odd question, but for my game I need to show just one area of the setting (imagine a rectangular slice of a terrain) and all objects out of this area need to be culled away. I tried to do this using shaders for clipping, but objects out of the area are rendered anyway, they just are not visible.

My question is whether it's possible to have a culling process in Unity independently of the actual rendering camera, so that the culling camera would determine which objects are out of the visible area (imagine an orthogonal camera pointing downwards with dimensions the size of the visible area), and the rendering camera would cull those that are out of the frustum volume.

Is this somehow possible? If not, how do I cull manually the objects out of my visible area (trees, etc.) and how do I set them invisible to hide them from view - and I don't mean setting them to alpha=0 or some trick to make them invisible, I mean not being rendered at all.

Thanks in advance,

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 Josh707 · Feb 10, 2013 at 03:42 AM 0
Share

Hey, you could use CalculateViewFrustum() and then TestPlanesAABB() to check for objects within the cameras viewport, then disable all of their renderers. Use google for the functions.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Johan 4 · Jun 02, 2011 at 03:35 PM

To not render an object, disable it's mesh renderer or the object altogether. Also your idea for culling is not possible.

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

Answer by save · Jun 02, 2011 at 04:28 PM

You could alter the render distance for the layers in real time (which might be a workaround for you). http://unity3d.com/support/documentation/ScriptReference/Camera-layerCullDistances.html

You could trigger this via a collider and a for-loop for either switching the layer for the particular objects inside or altering the distances for your layers.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Culling, cameras and viewports and clipping issues, Oh my! 0 Answers

How to cut off these clouds on my camera? 1 Answer

Is it possible to render a solid color where the Camera clips to the Near Clipping Plane? 1 Answer

GameObject disappear as I move/rotate the camera 1 Answer

Where To Learn Occlusion Culling Scripts 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