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 chillypacman · Nov 24, 2013 at 01:38 PM · cameraperformance

Performance impact of camera that has 'nothing' culling mask and doesn't clear anything?

I need to create a gameobject with a camera attached to it, the camera has to be enabled and have its depth set to '100' but besides those two things it doesn't need to do anything at all.

If I set the clear flags to 'don't clear' and the culling mask to 'nothing' will this mean it has no performance impact asf ar as rendering goes?

Comment
Add comment · Show 3
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 Tomer-Barkan · Nov 24, 2013 at 01:44 PM 0
Share

That would very much depend on how Unity implemented it, and I'd imagine that's not a use case they had in $$anonymous$$d, so if it is very efficient as you hope, then it's probably by luck.

But the best way to get an answer would be to do some testing. Create a prefab of such a camera, and instantiate a few hundred of those in a script, and see how it affects the framerate.

You may want to compare it to creating the same amount of empty gameobjects (without a camera) to see the specific performance impact of the camera itself.

avatar image Tomer-Barkan · Nov 24, 2013 at 01:47 PM 0
Share

BTW, I'm assu$$anonymous$$g you'd need to use the camera once in a while for ScreenToWorldPoint, or something like that (otherwise you wouldn't put it there at all...) so consider disabling the camera component, and only enabling it when you need to, ins$$anonymous$$d of playing with the culling and clear flags. Disabling a component is something that is designed to improve performance among other things.

avatar image chillypacman · Nov 24, 2013 at 01:50 PM 0
Share

The camera needs to remain active.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Nov 24, 2013 at 03:03 PM

Well, the performance impact of the "concept" of a camera is relatively low. A camera is literally just a transformation matrix (the Transform component) and a projection matrix (in the camera component itself). If you don't clear and don't draw any geometry with it, it literally does nothing beside some setup overhead. It might go through all renderers to check the layermask, but if nothing is used it's probably skipping this. Even if not that's nothing to worry about. In comparison to your actual camera it's workload is probably way below 1%

May i ask why the camera has to be active? Even disabled cameras can be used for rendering by calling the Render function manually. Since your camera does nothing i don't see the reason why it should be enabled? Some insight on the purpose?

edit
If you might just want an OnRender callback or something like that, just use OnGUI!

The repaint event is always invoked after all cameras have finished rendering. So it'S the perfect place to do some post rendering stuff. You can even render (disabled) cameras there manually which i did quite often ;)

Comment
Add comment · Show 1 · 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 NoobWhisperer · Mar 04, 2014 at 05:16 PM 0
Share

I am seeing a large performance issue caused by camera culling for a second camera that only renders one object. The second camera is used for a special effect and has only one object in an "effect" layer.

Performance tests indicate that Unity is doing an expensive camera culling operation behind the scenes BEFORE checking the layer culling mask of the second camera for the "effect" layer. That is, it appears to be perfor$$anonymous$$g frustum culling or other expensive filtering on objects that are not even in the layer the second camera is rendering!

Behind the scenes I'd like the camera to simply hold a list of the objects in it's layer and only perform frustum culling on those objects. In my case it would be even higher performance if the camera did no frustum culling at all and simply rendered the objects in it's layer (I already know they all need to be rendered).

Does anyone know a way to set up a camera to avoid frustum culling checks for objects that are not in the camera's layer(s)?

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

camera.layerCullDistances not working on gameobject with combinechildren 1 Answer

What are the performance issue of using multiple camera in layers (Mobile) 0 Answers

Camera Follow Code Causes Jerky Movements 2 Answers

When do shaders compute? 1 Answer

Second camera in editor causes flicker/judder/lag in VR image. 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