declare const _default: "\nvar sourceTexture: texture_2d;\nvar sourceTextureSampler: sampler;\nuniform sourceInvResolution: vec2f;\nvarying uv0: vec2f;\n\n#ifdef PREMULTIPLY\n var premultiplyTexture: texture_2d;\n var premultiplyTextureSampler: sampler;\n#endif\n\n#ifdef PREFILTER\n // x: threshold, y: knee\n uniform prefilterThresholdKnee: vec2f;\n#endif\n\n@fragment\nfn fragmentMain(input: FragmentInput) -> FragmentOutput {\n var output: FragmentOutput;\n\n let e: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, input.uv0).rgb);\n\n #ifdef BOXFILTER\n var value: half3 = e;\n\n #ifdef PREMULTIPLY\n let premultiply: half = half(textureSample(premultiplyTexture, premultiplyTextureSampler, input.uv0).{PREMULTIPLY_SRC_CHANNEL});\n value *= premultiply;\n #endif\n #else\n\n let x: f32 = uniform.sourceInvResolution.x;\n let y: f32 = uniform.sourceInvResolution.y;\n\n let a: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - 2.0 * x, input.uv0.y + 2.0 * y)).rgb);\n let b: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x, input.uv0.y + 2.0 * y)).rgb);\n let c: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + 2.0 * x, input.uv0.y + 2.0 * y)).rgb);\n\n let d: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - 2.0 * x, input.uv0.y)).rgb);\n let f: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + 2.0 * x, input.uv0.y)).rgb);\n\n let g: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - 2.0 * x, input.uv0.y - 2.0 * y)).rgb);\n let h: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x, input.uv0.y - 2.0 * y)).rgb);\n let i: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + 2.0 * x, input.uv0.y - 2.0 * y)).rgb);\n\n let j: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - x, input.uv0.y + y)).rgb);\n let k: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + x, input.uv0.y + y)).rgb);\n let l: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x - x, input.uv0.y - y)).rgb);\n let m: half3 = half3(textureSample(sourceTexture, sourceTextureSampler, vec2f(input.uv0.x + x, input.uv0.y - y)).rgb);\n\n var value: half3 = e * half(0.125);\n value += (a + c + g + i) * half(0.03125);\n value += (b + d + f + h) * half(0.0625);\n value += (j + k + l + m) * half(0.125);\n #endif\n\n #ifdef REMOVE_INVALID\n value = max(value, half3(0.0));\n #endif\n\n #ifdef PREFILTER\n // Soft-knee high pass: scale the result down by how far its brightest channel sits below\n // the threshold, with a quadratic knee of half the threshold smoothing the transition.\n // This runs on the filtered result rather than on each tap, so an isolated bright pixel,\n // which the filter has already averaged down, needs a proportionally lower threshold.\n let luminance: half = max(value.r, max(value.g, value.b));\n let threshold: half = half(uniform.prefilterThresholdKnee.x);\n let knee: half = half(uniform.prefilterThresholdKnee.y);\n var soft: half = clamp(luminance - threshold + knee, half(0.0), half(2.0) * knee);\n soft = soft * soft / (half(4.0) * knee + half(1e-4));\n value *= clamp(max(soft, luminance - threshold) / max(luminance, half(1e-4)), half(0.0), half(1.0));\n #endif\n\n output.color = vec4f(vec3f(value), 1.0);\n return output;\n}\n"; export default _default;