declare const _default: "\n varying vec2 uv0;\n uniform sampler2D smaaColorTexture;\n uniform sampler2D smaaBlendTexture;\n\n // 1 / width, 1 / height, width, height of the scene\n uniform vec4 smaaMetrics;\n\n // the exposure the scene is displayed with\n uniform float smaaExposure;\n\n #include \"reversibleTonemapPS\"\n\n // below this alpha, the color of a blended pixel is not divided out of its alpha\n #define SMAA_UNPREMULTIPLY_ALPHA (1.0 / 255.0)\n\n // The scene is linear HDR, where blending a bright pixel with a dark one by half gives a\n // result still displayed as bright as the bright one - so the edge would stay aliased. The\n // colors are blended compressed by a reversible tone mapping of their exposed values instead,\n // and expanded back after. The compressed colors are blended premultiplied by their alpha, so\n // that the color of a transparent pixel, which is not displayed, does not tint the pixels\n // blended with it - and the alpha is divided out before the expansion, which is not linear.\n vec4 smaaCompress(vec4 color, float exposure) {\n return vec4(reversibleTonemap(color.rgb * exposure) * color.a, color.a);\n }\n\n // the blended color, with its alpha divided out - a pixel left transparent keeps its color\n vec4 smaaExpand(vec4 blended, vec4 color, float exposure) {\n vec3 rgb = blended.a > SMAA_UNPREMULTIPLY_ALPHA ? reversibleTonemapInverse(blended.rgb / blended.a) / exposure : color.rgb;\n return vec4(rgb, blended.a);\n }\n\n void main(void) {\n vec2 texel = smaaMetrics.xy;\n\n // the blending weights of the pixel, along with those its right and bottom neighbors\n // hold for it\n vec4 a;\n a.x = texture2DLod(smaaBlendTexture, uv0 + vec2(texel.x, 0.0), 0.0).a;\n a.y = texture2DLod(smaaBlendTexture, uv0 + vec2(0.0, texel.y), 0.0).g;\n a.wz = texture2DLod(smaaBlendTexture, uv0, 0.0).xz;\n\n vec4 color = texture2DLod(smaaColorTexture, uv0, 0.0);\n\n // a pixel on an edge blends with its neighbors on either side, along the direction of the\n // stronger edge\n if (dot(a, vec4(1.0)) >= 1.0e-5) {\n bool horizontal = max(a.x, a.z) > max(a.y, a.w);\n vec2 dir = horizontal ? vec2(texel.x, 0.0) : vec2(0.0, texel.y);\n vec2 fraction = horizontal ? a.xz : a.yw;\n vec2 weight = fraction / dot(fraction, vec2(1.0));\n\n float e = max(smaaExposure, 1.0e-6);\n vec4 center = smaaCompress(color, e);\n vec4 positive = smaaCompress(texture2DLod(smaaColorTexture, uv0 + dir, 0.0), e);\n vec4 negative = smaaCompress(texture2DLod(smaaColorTexture, uv0 - dir, 0.0), e);\n vec4 blended = weight.x * mix(center, positive, fraction.x) + weight.y * mix(center, negative, fraction.y);\n color = smaaExpand(blended, color, e);\n }\n\n gl_FragColor = color;\n }\n"; export default _default;