Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Variable BLOOM_THRESHOLD_FRAGMENT_SHADERConst

    BLOOM_THRESHOLD_FRAGMENT_SHADER: "\n precision highp float;\n in vec2 vUv;\n out vec4 fragColor;\n\n uniform sampler2D uInput;\n uniform vec2 uTexelSize;\n uniform float uThreshold;\n uniform float uSmoothing;\n\n // Soft-knee: smoothstep around the threshold on relative luma, then\n // multiply by the source color (preserves chroma; only the brightness\n // gate is luma-based).\n vec3 thresholdKnee(vec3 color) {\n float l = dot(color, vec3(0.2126, 0.7152, 0.0722));\n float soft = smoothstep(uThreshold, uThreshold + uSmoothing, l);\n return color * soft;\n }\n\n void main() {\n // 2x2 box downsample\n vec2 d = uTexelSize * 0.5;\n vec3 s0 = texture(uInput, vUv + d * vec2(-1.0, -1.0)).rgb;\n vec3 s1 = texture(uInput, vUv + d * vec2( 1.0, -1.0)).rgb;\n vec3 s2 = texture(uInput, vUv + d * vec2(-1.0, 1.0)).rgb;\n vec3 s3 = texture(uInput, vUv + d * vec2( 1.0, 1.0)).rgb;\n vec3 avg = (s0 + s1 + s2 + s3) * 0.25;\n fragColor = vec4(thresholdKnee(avg), 1.0);\n }\n" = ...

    Threshold + 2× box downsample. Extracts bright pixels above the threshold with a smooth knee to avoid banding at the cutoff.

    Uses Rec.709 relative luminance for the brightness test. An earlier version used max(r,g,b), which overstated saturated-channel pixels — e.g. pure red would bloom even at low intensity.