- Home /
Multiple camera depth sorting issues
I have two cameras in my scene. One is used to render most objects, the other is used to render certain objects that require an entirely different approach.
For the 2nd camera, I'm calling Render() on it in the OnPreRender() function on a script attached to the main camera, and using a replacement shader to get part of the effect I need.
In OnRenderImage() I composite the two camera's outputs to make one final image (using Blit() and some other shuffling around).
For some reason, whatever the 2nd camera renders is always messed up, with faces that should be behind other faces getting drawn on top of them, even within the same mesh. IE, a car that is behind a person will be drawn on top of that person, but the person's back leg will get drawn in front of their front leg, as well. All kinds of wacky.
Has anyone run into this before? Anyone have any suggestions?
This post might be helpful: http://answers.unity3d.com/questions/643361/multiple-rendertexture-and-depth-buffer.html
Your answer
Follow this Question
Related Questions
Render Splitscreen to RenderTexture 0 Answers
Fake crystal using render textures 1 Answer
From flat image to pseudo-3D, how to manage a texture/depth map couple ? 0 Answers
Can I render depth and color? 0 Answers
Multiple camera question 2 Answers