Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How do I render a scene's depth buffer when I have custom vertex shaders?

$
0
0
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!

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>