- Home /
Disabling Shader by adding new Cameras to the Scene
Hello
I was wondering this time about optimization side of multiple cameras in the scene and my question is:
Question : I have Main Camera with Post Processing Shader added in the Scene ThisOne but I also have my UI (User Interface). I want my game scene to have applied effects from Post Processing Shader mentioned above, but I do not want it to be applied to UI, so I was wondering since in Canvas there is this Option Render Camera where I can set certain Canvas to have that Render Camera option set to none (If that a solution, should it always have camera there?) ... and so if I set it to none Unity suggests to make Camera Overlay instead. Also there is another solution I was thinking about and that is to create another camera that has no Shader added, which solution is better?
Thank you for the time spend reading it and hopefully answering.
Answer by Daemonhahn · Nov 09, 2017 at 12:31 PM
Just make an extra camera, set its culling layer to not include the UI. On your other camera, set its culling layer to only include the UI. Set the UI camera depth to higher than the other camera depth.
You now have two cameras, one for just UI and one for just other elements, and because neither is drawing twice, is almost as optimized as having all in one camera.