- Home /
How can you render custom sky backgrounds using multiple cameras when shaders rely on GrabPass
Hey everyone,
So here's the problem. We have a dynamic weather system in place in our project to replace the basic skybox approach. Currently this sky is being rendered by the MainCamera and thus our far plane is set to a ridiculous 15000 when 1000 is plenty for everything but the sky. Because of this our depth buffer is losing all precision and thus any other shaders relying on the depth buffer, like SSAO look absolutely horrible.
To fix this I decided to approach the problem by rendering only the sky with one camera (with a depth 1 less than the main camera) and everything else on the main camera. This allows me to keep the far plane on the main camera to a more realistic 1000ish. Of course this now means that the main cameras clear flag is now set to "Depth Only" so it does not immediately clear what I just rendered with the other camera.
Your answer
Follow this Question
Related Questions
How can I make a quad render below absolutely everything else? 1 Answer
Changing Texture From a Point? 0 Answers
Best way to make an unlit Cg shader 2 Answers
Galaxy background shader CG 0 Answers