export declare const vertexShader = "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n "; export declare const fragmentShader = "\n uniform sampler2D uTexture;\n uniform vec2 uResolution;\n uniform vec2 uTextureSize;\n uniform vec2 uMouse;\n uniform float uParallaxStrength;\n uniform float uDistortionMultiplier;\n uniform float uGlassStrength;\n uniform float ustripesFrequency;\n uniform float uglassSmoothness;\n uniform float uEdgePadding;\n \n varying vec2 vUv;\n \n vec2 getCoverUV(vec2 uv, vec2 textureSize) {\n if (textureSize.x < 1.0 || textureSize.y < 1.0) return uv;\n \n vec2 s = uResolution / textureSize;\n float scale = max(s.x, s.y);\n \n vec2 scaledSize = textureSize * scale;\n vec2 offset = (uResolution - scaledSize) * 0.5;\n \n return (uv * uResolution - offset) / scaledSize;\n }\n \n float displacement(float x, float num_stripes, float strength) {\n float modulus = 1.0 / num_stripes;\n return mod(x, modulus) * strength;\n }\n \n float fractalGlass(float x) {\n float d = 0.0;\n for (int i = -5; i <= 5; i++) {\n d += displacement(x + float(i) * uglassSmoothness, ustripesFrequency, uGlassStrength);\n }\n d = d / 11.0;\n return x + d;\n }\n\n float smoothEdge(float x, float padding) {\n float edge = padding;\n if (x < edge) {\n return smoothstep(0.0, edge, x);\n } else if (x > 1.0 - edge) {\n return smoothstep(1.0, 1.0 - edge, x);\n }\n return 1.0;\n }\n \n void main() {\n vec2 uv = vUv;\n \n float originalX = uv.x;\n \n float edgeFactor = smoothEdge(originalX, uEdgePadding);\n \n float distortedX = fractalGlass(originalX);\n \n uv.x = mix(originalX, distortedX, edgeFactor);\n \n float distortionFactor = uv.x - originalX;\n \n float parallaxDirection = -sign(0.5 - uMouse.x);\n \n vec2 parallaxOffset = vec2(\n parallaxDirection * abs(uMouse.x - 0.5) * uParallaxStrength * (1.0 + abs(distortionFactor) * uDistortionMultiplier),\n 0.0\n );\n \n parallaxOffset *= edgeFactor;\n \n uv += parallaxOffset;\n \n vec2 coverUV = getCoverUV(uv, uTextureSize);\n \n if (coverUV.x < 0.0 || coverUV.x > 1.0 || coverUV.y < 0.0 || coverUV.y > 1.0) {\n coverUV = clamp(coverUV, 0.0, 1.0);\n }\n \n vec4 color = texture2D(uTexture, coverUV);\n \n gl_FragColor = color;\n }\n "; //# sourceMappingURL=FractalGlassShaders.d.ts.map