The problem is :
I have two cameras, A for the main 3d scene, B for renderering guis behind the main 3d scene. The reseon two use two cameras is GUITEXTURE and GUITEXT are always on top of the main scene.
for A I set Clear flags to depth only, depth to -1, culling mask to the main 3D scene
for B I set clera flags to solid color, depth to -3, culling mask to the layer I define for the guis,rendering path is forward.
The problem is that if I set A's rendering path to forward, everything goes fine. If I set it to "deferred lighting", It seems only can see the 3D scene, and everything without any depth values becomes black and can not see the behind guis. Seems "depth only" does not work in defered lighting mode. Is that a bug on something?
If I turn off camera A, I can see the guis rendered by camera B. So I guess the contents in camrea A just occlude camera B's contents because "depth only"clearing mask does not work in deferred lighting cameras
Is here the right place to ask or I should ask at scripting forum?
Resident Lightmap Whore and person voted least likely to take the Apocalypse seriously.
I'm a PC, and hiding porn on your computer was my idea.
Support these plugins: Playmaker, uLink, SSE and Volume Grass. Or I'll set Miss Piggy on you.
Hire niosop - awesome programmer, a genius actually!
It's too hot to work right now!
thanks, has anybody met similar problems before? Is this really a bug that unity have problems on depth rendering in deferred lighting mode? I'm using 3.2.0f4 pro
the problem you're describing is a known issue. It is caused by the fact that the final pass of prepass rendering (so the pass that renders the geometry the second time and applies the result of the lighting pass to it) is rendered into a render texture. Then it is just blit-copied into the back buffer, overriding everything that was rendered there before.
Fixing that problem requires some changes in other subsystems, so won't be a quick one, but it has been placed on our roadmap.
A workaround is probably possible if the second camera (the deferred one) would render into a render texture and you would handle compositing that with the first camera's output yourself.