Variable GLSL_GLASS_PARTITION_GUARDConst
GLSL_GLASS_PARTITION_GUARD: "\n if (uGlassPartition != 0) {\n float glassDepth = texelFetch(uGlassDepth, ivec2(gl_FragCoord.xy), 0).r;\n bool inFrontOfGlass = glassDepth < 1.0 && gl_FragCoord.z < glassDepth;\n if (uGlassPartition == 1 && inFrontOfGlass) discard;\n if (uGlassPartition == 2 && !inFrontOfGlass) discard;\n }\n" = ...
The GLSL classification, to be the FIRST statement of
main()in every WebGL data fragment shader.gl_FragCoord.zis the fragment's own window depth (no visual shader writesgl_FragDepth) and the depth target is the HDR target's size, so the integertexelFetchat the fragment's own pixel is exact and needs no resolution uniform.