Skip to content

MC_HAND_DEPTH

MC_HAND_DEPTH

The clip space depth multiplier applied to geometry in gbuffers_hand and gbuffers_hand_water.

The multiplier is applied in clip space automatically through the projection matrix. When working backwards from the depth buffer, the multiplier should be applied in NDC space rather than screen space to produce the correct result, for example:

float screenDepth = textureLod(depthtex0, texcoord, 0.0).r;
float ndcDepth = (screenDepth * 2.0 - 1.0) / MC_HAND_DEPTH;