export declare const LASER_VERTEX_SHADER = "\nattribute vec2 a_position;\n\nvoid main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n}\n"; export declare const LASER_FRAGMENT_SHADER = "\nprecision highp float;\n\nuniform vec2 u_resolution;\nuniform vec2 u_pointer;\nuniform float u_time;\nuniform float u_variant;\nuniform float u_size;\nuniform float u_length;\nuniform float u_density;\nuniform float u_hue;\nuniform float u_saturation;\nuniform float u_brightness;\n\nfloat hash21(vec2 p) {\n p = fract(p * vec2(123.34, 456.21));\n p += dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nfloat valueNoise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash21(i), hash21(i + vec2(1.0, 0.0)), u.x),\n mix(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(1.0)), u.x),\n u.y\n );\n}\n\nfloat fbm(vec2 p) {\n float result = 0.0;\n float weight = 0.54;\n for (int i = 0; i < 4; i++) {\n result += valueNoise(p) * weight;\n p = mat2(1.62, 1.21, -1.21, 1.62) * p + 9.13;\n weight *= 0.48;\n }\n return result;\n}\n\nvec3 hsv2rgb(vec3 c) {\n vec3 p = abs(fract(c.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);\n return c.z * mix(vec3(1.0), clamp(p - 1.0, 0.0, 1.0), c.y);\n}\n\nvec3 accent(float baseHue, float saturationScale) {\n float hue = fract(baseHue + u_hue / 360.0);\n return hsv2rgb(vec3(hue, clamp(u_saturation * saturationScale, 0.0, 1.0), 1.0));\n}\n\nvec2 laserProfile(float distanceToLine, float coreWidth, float glowWidth) {\n float core = exp(-pow(distanceToLine / max(coreWidth, 0.0002), 2.0));\n float glow = exp(-pow(distanceToLine / max(glowWidth, 0.001), 1.25));\n return vec2(core, glow);\n}\n\nvec3 atmosphericBlade(vec2 p) {\n float drift = sin(u_time * 0.21) * 0.025;\n float center = u_pointer.x * 0.16 + drift;\n float tilt = u_pointer.x * 0.055 + sin(u_time * 0.13) * 0.018;\n float distanceToBeam = abs(p.x - center - p.y * tilt);\n float verticalMask = 1.0 - smoothstep(0.68 * u_length, 1.35 * u_length, abs(p.y));\n vec2 beam = laserProfile(distanceToBeam, 0.0028 * u_size, 0.052 * u_size);\n\n vec2 fogUv = vec2(p.x * 3.4, p.y * 2.15 - u_time * 0.075);\n fogUv.x += sin(p.y * 3.2 - u_time * 0.17) * 0.18;\n float fogNoise = fbm(fogUv + u_pointer * 0.35);\n float fogEnvelope = exp(-pow(distanceToBeam / (0.24 * u_size), 1.35));\n float fog = smoothstep(0.34, 0.78, fogNoise) * fogEnvelope * u_density * verticalMask;\n\n float mirageDistance = abs(abs(p.x - center + p.y * tilt * 0.35) - 0.105 * u_length);\n vec2 mirage = laserProfile(mirageDistance, 0.0011 * u_size, 0.016 * u_size);\n float mirageMask = (1.0 - smoothstep(0.08, 1.2, abs(p.y))) * (0.35 + 0.65 * fogNoise);\n\n vec3 tint = accent(0.43, 0.82);\n vec3 color = vec3(0.0025, 0.004, 0.006);\n color += tint * fog * 0.34;\n color += tint * beam.y * verticalMask * (0.48 + 0.06 * sin(u_time * 1.1));\n color += mix(tint, vec3(1.0), 0.88) * beam.x * verticalMask * 1.65;\n color += tint * mirage.y * mirageMask * 0.12 * u_density;\n color += vec3(0.8, 0.98, 0.9) * mirage.x * mirageMask * 0.35 * u_density;\n\n float contact = exp(-length(vec2((p.x - center) * 2.5, p.y + 0.77 * u_length)) * 7.0);\n color += tint * contact * 0.45;\n return color;\n}\n\nvec3 vanishingArray(vec2 p) {\n vec2 origin = vec2(u_pointer.x * 0.16, 0.12 + u_pointer.y * 0.075);\n vec2 q = p - origin;\n float radius = length(q);\n float angle = atan(q.y, q.x);\n float spokeCount = floor(11.0 + u_density * 10.0);\n float angularDistance = abs(sin(angle * spokeCount));\n float spoke = exp(-angularDistance * max(radius, 0.06) / (0.0075 * u_size));\n float reach = smoothstep(0.035, 0.16, radius) * (1.0 - smoothstep(0.42 * u_length, 1.55 * u_length, radius));\n float lowerField = 1.0 - smoothstep(-0.12, 0.22, q.y);\n float upperField = smoothstep(0.02, 0.52, q.y) * 0.48;\n float fieldMask = max(lowerField, upperField);\n\n float carrier = 0.55 + 0.45 * sin(radius * 16.0 - u_time * 4.1 + angle * 2.0);\n carrier = pow(max(carrier, 0.0), 7.0);\n float rail = spoke * reach * fieldMask;\n float railCore = pow(rail, 2.1);\n\n float ringPhase = abs(sin((radius * 13.0 - u_time * 1.5) / max(u_length, 0.35)));\n float rings = exp(-ringPhase / (0.035 * u_size)) * (1.0 - smoothstep(0.1, 1.2, radius)) * lowerField;\n float horizon = exp(-abs(q.y) / (0.0035 * u_size)) * (1.0 - smoothstep(0.12, 1.15, abs(q.x)));\n\n vec3 violet = accent(0.70, 0.78);\n vec3 amber = accent(0.055, 0.84);\n vec3 railTint = mix(violet, amber, 0.5 + 0.5 * sin(angle * 3.0));\n vec3 color = vec3(0.004, 0.0035, 0.009);\n color += railTint * rail * (0.24 + carrier * 0.72);\n color += mix(railTint, vec3(1.0), 0.9) * railCore * (0.52 + carrier * 0.92);\n color += violet * rings * 0.14 * u_density;\n color += vec3(0.82, 0.9, 1.0) * horizon * 0.38;\n color += violet * exp(-radius * 15.0) * 0.95;\n return color;\n}\n\nvec3 prismAperture(vec2 p) {\n vec2 center = u_pointer * vec2(0.12, 0.08);\n vec2 q = p - center;\n float breathing = 0.46 * u_length + sin(u_time * 0.72) * 0.012;\n float warp = (fbm(q * 3.2 + vec2(0.0, -u_time * 0.08)) - 0.5) * 0.025 * u_density;\n float diamond = abs(q.x * 0.82) + abs(q.y) - breathing - warp;\n float innerDiamond = abs(q.x * 0.82) + abs(q.y) - breathing * 0.66 + warp * 0.45;\n vec2 outer = laserProfile(abs(diamond), 0.0024 * u_size, 0.046 * u_size);\n vec2 inner = laserProfile(abs(innerDiamond), 0.0012 * u_size, 0.018 * u_size);\n\n float edgeMask = 1.0 - smoothstep(0.25, 1.18, length(q));\n float perimeterPhase = sin((q.x - q.y) * 15.0 - u_time * 3.3);\n float packets = pow(max(perimeterPhase, 0.0), 10.0) * outer.y;\n float axisX = exp(-abs(q.x) / (0.002 * u_size)) * (1.0 - smoothstep(0.04, breathing, abs(q.y)));\n float axisY = exp(-abs(q.y) / (0.002 * u_size)) * (1.0 - smoothstep(0.04, breathing, abs(q.x)));\n\n float redFringe = exp(-pow(abs(diamond - 0.011 * u_size) / (0.011 * u_size), 1.4));\n float blueFringe = exp(-pow(abs(diamond + 0.011 * u_size) / (0.011 * u_size), 1.4));\n vec3 tint = accent(0.79, 0.8);\n vec3 color = vec3(0.004, 0.0025, 0.007);\n color += tint * outer.y * edgeMask * 0.5;\n color += mix(tint, vec3(1.0), 0.9) * outer.x * edgeMask * 1.5;\n color += tint * inner.y * edgeMask * 0.18 * u_density;\n color += vec3(1.0) * inner.x * edgeMask * 0.48 * u_density;\n color += accent(0.98, 0.92) * redFringe * 0.13;\n color += accent(0.54, 0.9) * blueFringe * 0.16;\n color += vec3(0.92, 0.96, 1.0) * (axisX + axisY) * 0.2;\n color += tint * packets * 0.85;\n color += tint * exp(-length(q) * 9.0) * 0.22;\n return color;\n}\n\nvec3 halftoneRelay(vec2 p) {\n float center = 0.29 + u_pointer.x * 0.12;\n float bend = sin(p.y * 2.1 - u_time * 0.25) * 0.018;\n float mainDistance = abs(p.x - center - bend);\n float relayDistance = abs(p.x - center + 0.075 * u_length + bend * 0.45);\n vec2 mainBeam = laserProfile(mainDistance, 0.0022 * u_size, 0.072 * u_size);\n vec2 relayBeam = laserProfile(relayDistance, 0.0012 * u_size, 0.025 * u_size);\n\n vec2 fogUv = vec2(p.x * 3.0, p.y * 2.5 - u_time * 0.1);\n float fogNoise = fbm(fogUv + vec2(sin(u_time * 0.16), 0.0));\n float fog = smoothstep(0.28, 0.78, fogNoise) * exp(-mainDistance * 9.5 / u_size) * u_density;\n\n float dotScale = mix(9.0, 4.5, clamp((u_density - 0.25) / 2.25, 0.0, 1.0));\n vec2 dotCell = fract(gl_FragCoord.xy / dotScale) - 0.5;\n float dot = 1.0 - smoothstep(0.08, 0.34, length(dotCell));\n float dotMask = dot * smoothstep(0.08, 0.68, fog + mainBeam.y * 0.65);\n\n float pulse = pow(max(0.0, sin(p.y * 9.0 - u_time * 4.0)), 12.0);\n float horizontalRelay = exp(-abs(p.y + 0.34 - u_pointer.y * 0.08) / (0.0024 * u_size));\n horizontalRelay *= 1.0 - smoothstep(0.1, 1.05 * u_length, abs(p.x - center));\n\n vec3 tint = accent(0.54, 0.84);\n vec3 color = vec3(0.002, 0.005, 0.009);\n color += tint * fog * 0.24;\n color += tint * mainBeam.y * 0.54;\n color += mix(tint, vec3(1.0), 0.9) * mainBeam.x * 1.48;\n color += tint * relayBeam.y * 0.2;\n color += vec3(0.78, 0.95, 1.0) * relayBeam.x * 0.5;\n color += tint * dotMask * (0.3 + pulse * 0.42);\n color += mix(tint, vec3(1.0), 0.8) * horizontalRelay * (0.22 + pulse * 0.58);\n return color;\n}\n\nvoid main() {\n vec2 p = (gl_FragCoord.xy * 2.0 - u_resolution.xy) / min(u_resolution.x, u_resolution.y);\n vec3 color;\n\n if (u_variant < 0.5) {\n color = atmosphericBlade(p);\n } else if (u_variant < 1.5) {\n color = vanishingArray(p);\n } else if (u_variant < 2.5) {\n color = prismAperture(p);\n } else {\n color = halftoneRelay(p);\n }\n\n float vignette = 1.0 - smoothstep(0.24, 1.45, length(p * vec2(0.72, 0.88)));\n color *= 0.55 + vignette * 0.45;\n color *= u_brightness;\n color = color / (color + vec3(0.72));\n color = pow(max(color, vec3(0.0)), vec3(0.82));\n gl_FragColor = vec4(color, 1.0);\n}\n"; //# sourceMappingURL=laserShaders.d.ts.map