What it does

ZWrite controls whether a drawn surface stores its depth in the Depth Buffer. Later draws can use that depth to determine whether they are in front of or hidden behind it.

Figure: Conceptual relationship: Fragment → Pass depth tests → Write depth
Figure: Conceptual relationship: Fragment → Pass depth tests → Write depth

How to use it

Compare depth writing and order on opaque and transparent materials. A transparent surface with ZWrite Off can still use depth testing; it does not necessarily ignore occlusion.

A concrete example

Writing depth across a smoke card can hide later transparent cards, including areas intended to remain translucent. Alpha-clipped leaves discard pixels and have a different contract from smoke.

How to check it

  1. Inspect two intersecting translucent planes against a background.
    Testing and writing are separate settings
    Testing and writing are separate settings
  2. After changing depth writes, also test depth-dependent effects such as soft particles and depth of field.
    Testing and writing are separate settings
    Testing and writing are separate settings

Limitations

Enabling it on all transparents can hide other transparent surfaces.

References