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 /
  • Help Room /
avatar image
0
Question by frogwise · Mar 30, 2016 at 08:29 AM · cameramobileperformancelayersculling

Is using multiple cameras, culling masks, and layers expensive on mobile?

I have an endless runner game.

I have my background layer which has a bunch of scrolling art elements. This is culled with a background only camera on its own layer. It has a depth of -1.

I have a foreground layer which has a bunch of scrolling art elements. This is culled with a foreground only camera and its own layer as well. It has a depth of 1.

Then, my main camera is where the gameplay layer is, and it renders all that stuff together. It is set to a depth of 0.

This way, I can have an elegant little background art scrolling system on one layer, an elegant little foreground art layer on another, and worry about the complexities of the game-camera and gameplay on its own layer.

This method seems like an excellent workflow, but I am wondering how much of a performance impact this is on mobile? Should I just find a way to do all of those things using one camera, or is separating it like so the way to go?

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

· Add your reply
  • Sort: 
avatar image
0

Answer by Abhiroop-Tandon · Mar 30, 2016 at 11:36 AM

Everything comes with their own cost. You have three cameras rendering the same scene. It depends on the complexities of rendering. If you have high quality images all over the place and the scenes are long then yeah the phone can get laggy. You can try optimizing the quality of your gameObjects if you really need to have three cameras. What people usually try to do (at least i do sometimes) is have two cameras, one for the foreground and other for the background (for parallax effect). What i would suggest is if you can try reducing the number of cameras thats good, if you simply cannot then try optimizing your images and textures.

Comment
Add comment · Show 4 · 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 frogwise · Mar 30, 2016 at 05:10 PM 0
Share

Hm, is it really rendering the scene 3 times?

The objects that the cameras are looking at are fairly basic.

The background contains a background plane that has a scrolling texture offset. It also contains a few objects that move down the screen and warp back up to the top to loop.

The foreground camera looks at some objects that also scroll from top to bottom, and a screen based rain effect.

The reason I separated them like this is that my gameplay camera is moving upwards constantly, and I didn't want to attach all those scrolling systems to my main camera. Ins$$anonymous$$d, i felt it would be more economical and elegant to just have them statically doing their thing, and culled by separate cameras.

Not sure if this is the optimal solution now, though.

avatar image Abhiroop-Tandon · Mar 31, 2016 at 08:49 AM 0
Share

Ummm what i found was the cameras dont run on separate threads (which would make it efficient). So having less cameras is more efficient unless you really need something like a $$anonymous$$imap or something. Try finding another way to achieve what you want.

To be honest if you are too crazy about the efficiency of the game and all try reducing them, if its a small game and you dont care much about the efficiency just leave them there but the answer to your question according to me will be having less cameras is more efficient

avatar image frogwise · Mar 31, 2016 at 04:10 PM 0
Share

Thanks for the information. I am fascinated with this because I am reading conflicting information from various sources. In this article

http://blog.theknightsofunity.com/using-multiple-unity-cameras-why-this-may-be-important/

It clearly states:

"The conclusion is that different cameras can render different objects. This is important information even if you don’t know yet how to use it in practice. It also means that adding second camera will not re-draw your scene two times. Only objects visible to the second camera will be rendered. $$anonymous$$nowing this having multiple cameras rendering different layers will result in similar efficiency as rendering all these layers using only one camera."

But other people are saying it does render multiple passes.

avatar image Abhiroop-Tandon · Mar 31, 2016 at 07:00 PM 0
Share

Well then go with your gut feeling hahah what else should i say !!

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

78 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 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

Using two cameras to render different layers problem 0 Answers

Cinemachine On Mobile? 1 Answer

Render 2 cameras with same depth. Not split screen. 0 Answers

How to display a canvas through multiple cameras + use camera culling mask with UI? 0 Answers

Multiplayer Camera Layer Issues 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