DepthTex
uniform sampler2D depthtexN;
There are three samplers for accessing the depth buffer.
depthtex0includes all geometrydepthtex1excludes transparent geometrydepthtex2excludes transparent and hand geometry
These buffers can be read from any program, but will contain garbage data until the respective gbuffers shader has executed. For example, depthtex1 will first contain meaningful data in the deferred stage.
Writing
These buffers are automatically written to by gbuffers programs, and store the screenspace z coordinate at each pixel. You can manually write to this buffer by setting the gl_FragDepth variable in the fragment shader. If gl_FragDepth is used, it must have a value assigned for all execution paths. For more information see the OpenGL Docs.
Size
These buffers are the same resolution as the Minecraft window. This cannot be configured.
Format / precision
These buffers only store information in a single channel, the r component. The depth buffer precision is hardware / driver dependent. However, most hardware uses either 24-bit or 32-bit (R24 or R32) precision.
Clearing
All these buffers clear to vec4(1.0). This cannot be configured.
Flipping
These buffers do not flip.
Aliases Legacy
depthtex0 can be accessed through the legacy alias gdepthtex.