- Home /
Question by
_mm_ · Aug 16, 2017 at 07:26 PM ·
cameradepth buffer
Changing Depth Buffer Comparison Function for Specific Camera
Hi,
I need to render depth buffer that contains depth values of the farthest pixels of the back facing polygons. I use a camera that renders depth to the render texture (RenderTexture Format.Depth). For this camera, I enable inverse culling (GL.invertCulling), clear depth to "0", and I need to change depth comparison function to "ZTest Greater" for all shaders. Is there a way to set it globally (for a specific camera) without using replacement shaders?
The reason I don't want to use replacement shaders is that I use some specialized shaders and I can not replace them with shader containing only a generic ShadowCaster pass.
Thanks!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612132843im_/https://answers.unity.com/themes/thub/images/avi.jpg)