export declare const CRT_VERTEX_SHADER = "attribute vec2 aPos;\nvoid main(){ gl_Position = vec4(aPos,0.0,1.0); }"; export declare const CRT_FRAGMENT_SHADER = "precision highp float;\nuniform sampler2D uTex;\nuniform vec2 uRes;\nuniform float uTime;\nuniform float uMotion;\nuniform vec2 uCurve;\nuniform float uScan;\nuniform float uScanDepth;\nuniform float uTriad;\nuniform float uGrille;\nuniform float uChroma;\nuniform float uBar;\nuniform float uFlicker;\nuniform float uGrain;\nuniform float uNoise;\nuniform float uVignette;\nuniform float uMono;\nuniform float uGain;\nuniform float uHalo;\nuniform vec3 uSheen;\nuniform vec3 uRoom;\n\nfloat hash(vec2 p){ p=fract(p*vec2(123.34,456.21)); p+=dot(p,p+45.32); return fract(p.x*p.y); }\n\nvec2 curve(vec2 uv){\n uv = uv*2.0-1.0;\n vec2 o = uv.yx*uv.yx;\n uv += uv * o * uCurve;\n uv = uv*0.5+0.5;\n return uv;\n}\n\nvoid main(){\n vec2 fuv = gl_FragCoord.xy / uRes;\n vec2 uv = curve(fuv);\n float t = uTime;\n\n /* analogue transport faults: per-row jitter, a rolling dropout band, and the\n head-switching scramble along the bottom edge of the raster */\n float band = 0.0;\n if (uNoise > 0.001){\n float row = floor(uv.y * 190.0);\n float gate = step(0.905, hash(vec2(row, floor(t*15.0))));\n uv.x += (hash(vec2(row*1.7, floor(t*15.0)+7.0)) - 0.5) * 0.052 * gate * uNoise;\n float pos = fract(uv.y * 0.8 - t * 0.17);\n band = smoothstep(0.075, 0.0, pos);\n uv.x += band * (hash(vec2(floor(uv.y*260.0), floor(t*26.0))) - 0.5) * 0.030 * uNoise;\n float head = smoothstep(0.030, 0.0, uv.y);\n uv.x += head * (hash(vec2(floor(uv.y*520.0), floor(t*22.0))) - 0.32) * 0.075 * uNoise;\n band = max(band, head);\n }\n\n vec2 inb = step(vec2(0.0), uv) * step(uv, vec2(1.0));\n float inside = inb.x*inb.y;\n vec2 ed = min(uv, 1.0-uv);\n inside *= smoothstep(0.0,0.020, min(ed.x,ed.y));\n\n vec2 dir = uv-0.5;\n float d2 = dot(dir,dir);\n vec2 ao = dir * (0.0010 + 0.0075*d2) * uChroma;\n vec3 col;\n col.r = texture2D(uTex, uv + ao).r;\n col.g = texture2D(uTex, uv).g;\n col.b = texture2D(uTex, uv - ao).b;\n\n /* phosphor halation: a wide cheap tap ring so bright glyphs bloom into the\n glass instead of relying on the text canvas alone */\n if (uHalo > 0.001){\n float s = 0.0038;\n vec3 wide = texture2D(uTex, uv + vec2( s, 0.0)).rgb\n + texture2D(uTex, uv + vec2(-s, 0.0)).rgb\n + texture2D(uTex, uv + vec2(0.0, s)).rgb\n + texture2D(uTex, uv + vec2(0.0, -s)).rgb\n + texture2D(uTex, uv + vec2( s, s)*0.72).rgb\n + texture2D(uTex, uv + vec2(-s, -s)*0.72).rgb;\n col += wide * (uHalo / 6.0);\n }\n\n float sl = sin(uv.y*3.14159265*uScan + t*4.0*uMotion);\n col *= mix(1.0 - uScanDepth, 1.0, sl*sl);\n\n float gx = gl_FragCoord.x * (6.2831853/max(uTriad, 1.0));\n vec3 grille = (1.0-uGrille) + uGrille*cos(gx + vec3(0.0,2.094,4.188));\n col *= mix(vec3(1.0), grille, step(0.001, uGrille));\n col *= uGain;\n\n float bar = fract(uv.y*0.5 - t*0.07*uMotion);\n bar = smoothstep(0.0,0.05,bar)*smoothstep(0.18,0.05,bar);\n col += bar*uBar*uMotion;\n\n float sheen = smoothstep(0.55,0.0, distance(uv, vec2(0.50,0.15)));\n col += sheen*0.030*uSheen;\n\n float vig = smoothstep(0.98,0.30, length((uv-0.5)*vec2(1.05,1.0)));\n col *= mix(1.0-uVignette, 1.0, vig);\n col *= 1.0 - uFlicker*uMotion*sin(t*8.0);\n\n if (uNoise > 0.001){\n float st = hash(fuv*uRes*0.5 + vec2(floor(t*24.0), floor(t*24.0)*1.7));\n col += (st-0.5)*0.135*uNoise;\n col += band*0.085*uNoise;\n }\n col += (hash(fuv + fract(t*0.37)) - 0.5)*uGrain;\n\n float luma = dot(col, vec3(0.2126,0.7152,0.0722));\n col = mix(col, vec3(luma), uMono);\n\n float spill = smoothstep(0.85,0.18, length(fuv-0.5))*0.05;\n vec3 room = uRoom + uSheen*spill*0.42;\n col = mix(room, col, inside);\n col = max(col, uRoom*0.34);\n gl_FragColor = vec4(col,1.0);\n}"; //# sourceMappingURL=crtShaders.d.ts.map