#Overwriting depth texture with "obscured" geometry

1 messages · Page 1 of 1 (latest)

thick moon
#

I'm using a simple hole shader to render trenches/craters below the flat ground plane. However, these holes do not affect the depth texture for post-processing effects (fog, ambient occlusion, etc.). Is there any easy way to get the lower geometry to overwrite the depth texture?

#

here's how it should look except for the missing ground

kind imp
#

I don't know if it's controllable in unity somewhere, but on the graphics api level, you can set the depth test/write action as overwrite. Then it should work as long as the trench is rendered after the ground.

#

Probably you can set that in shaderlab