export declare const luminosity_frag = "\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tColorOpaque;\nuniform sampler2D tColorTransparent;\nuniform sampler2D tEmissive;\nuniform sampler2D tDepthOpaque;\nuniform sampler2D tDepthTransparent;\nuniform vec2 uTexSizeInv;\n\nuniform vec3 uDefaultColor;\nuniform float uDefaultOpacity;\nuniform float uLuminosityThreshold;\nuniform float uSmoothWidth;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uIsOrtho;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform bool uOpaqueFogged;\n\n#include common\n\nfloat getDepthOpaque(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepthOpaque, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepthOpaque, coords));\n #endif\n}\n\nfloat getDepthTransparent(const in vec2 coords) {\n return unpackRGBAToDepthWithAlpha(texture2D(tDepthTransparent, coords)).x;\n}\n\nfloat getDepth(const in vec2 coords) {\n return min(getDepthOpaque(coords), getDepthTransparent(coords));\n}\n\nbool isBackground(const in float depth) {\n // (2^24 - 1) / 2^24, max of 24-bit packed depth; also passes raw fp32.\n return depth >= 0.99999994;\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy * uTexSizeInv;\n vec4 opaqueTexel = texture2D(tColorOpaque, coords);\n vec4 transparentTexel = texture2D(tColorTransparent, coords);\n // fog illumination's un-fogged opaque seed by the opaque depth, matching standard's per-layer fog\n if (!uOpaqueFogged) {\n opaqueTexel.rgb *= 1.0 - smoothstep(uFogNear, uFogFar, abs(depthToViewZ(uIsOrtho, getDepthOpaque(coords), uNear, uFar)));\n }\n // PMA OVER composite, matches postprocessing's final transparency blend.\n vec4 texel = transparentTexel + opaqueTexel * (1.0 - transparentTexel.a);\n float emissive = texture2D(tEmissive, coords).a;\n float depth = getDepth(coords);\n\n if (isBackground(depth)) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n return;\n }\n\n vec4 outputColor = vec4(uDefaultColor.rgb, uDefaultOpacity);\n\n #if defined(dMode_luminosity)\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float v = dot(texel.xyz, luma);\n float alpha = smoothstep(uLuminosityThreshold, uLuminosityThreshold + uSmoothWidth, v);\n\n gl_FragColor = mix(outputColor, texel, alpha);\n #elif defined(dMode_emissive)\n // the prepass already holds the fogged emissive color, free of lighting/exposure\n gl_FragColor = texture2D(tEmissive, coords);\n #endif\n}\n";