- Home /
How do I render a scene's depth buffer when I have custom vertex shaders?
Hi,
I have a Unity scene, and for some of my effects I'd like to create a depth buffer of my scene. I'd even like transparent objects to (optionally) write into this depth buffer.
My main problem is that my scene contains many objects that have custom vertex shaders, such as objects that move in the wind, or project onto surfaces. This means I can't use Camera.RenderWithShader() with a specific depth-write shader, as the vertex shader would have to swap with each object.
Does anyone know how I can do this? It must be possible, because this is how the ShadowCasting pass works. But I just can't find the Unity secret sauce to let me do it.
Thanks in advance!
Your answer
Follow this Question
Related Questions
Shadow artifacts on vertex animation shader 1 Answer
Weird shader behavior , when displacing vertices. 1 Answer
Need to get lighting to work on bending vertex shader... 1 Answer
Vertex Shader problem with _WorldSpaceCameraPos 1 Answer
Receive Shadows with Custom Vertex Shader & Shadow Passes Functioning Incorrectly 1 Answer