What it does
The Depth Buffer stores surface depth at screen locations. ZTest compares new geometry with stored depth, and ZWrite updates it. This lets nearer objects hide surfaces behind them.
How to use it
ZWrite stores depth on a render target and ZTest compares later fragments against it. A sampled depth texture can be copied or generated separately.
A concrete example
Z-fighting between nearly coincident planes requires investigating precision and geometry overlap. Disabling depth can hide the symptom while breaking wall occlusion.
How to check it
- Inspect clipping ranges and surface separation.
Testing and writing are separate settings - Because transparent materials may not write depth, compare the visible image with the actual depth contents.
Testing and writing are separate settings
Limitations
A sampled depth texture is not always the same resource/workflow; inspect precision and projection.