Reeded Glass Effect
Reeded Glass is a WebGL effect that turns any element into a sheet of fluted glass: the animated gradient background behind it bends, blurs, and splits into subtle rainbow fringes through each ribbed ridge, complete with film grain and a soft vignette for a realistic frosted look. It also respects the browser’s “prefers-reduced-motion” setting, freezing the animation for users who are sensitive to movement.
We Put Frosted Glass Over Everything.
We Spent Six Weeks on the Hero Section.
It Works on My Machine
Instructions
Below is a walkthrough of every option you can pass to initReededGlass, along with what it actually does in the shader code.
stripesCount (default: 14)
The number of vertical "reeded" ridges (the fluted glass lines) across the effect. The fragment shader computes the stripe pattern with fract((rx + 0.5) * uStripesCount), so higher values mean more, thinner ridges; lower values mean fewer, wider ridges. In the example call it's set to 31, giving a dense ribbed texture.
reedStrength (default: 0.05)
How strongly the glass distorts (refracts) the background image along the direction of the ridges. It's applied via uv = vUv + distortionRawUv * uReedStrength * 0.5, so bigger values create a stronger, more exaggerated bending of the background through each glass stripe. The example uses 0.31 for a pronounced refraction.
chromaticStrength (default: 0.01)
The intensity of chromatic aberration — the red and blue channels are sampled at slightly offset positions (sampleUv ± chromaOffset) to fake light dispersing through the glass like a prism. Higher values produce more visible red/blue fringing at the edges of the ridges. Set to 0.046 in the example for a noticeable prismatic edge.
blurStrength (default: 40)
Controls how much the background is blurred behind the glass. The shader samples 16 points arranged in a golden-angle spiral (a common technique for smooth, fast blur), and this value scales the radius of that sampling circle. Higher = softer, dreamier background. The example uses 54.
glassColor (default: "#ffffff")
A hex color that gets mixed into the glass tint. It only matters when glassOpacity is greater than 0 — it defines what color the tint is.
glassOpacity (default: 0)
How strongly glassColor is blended over the scene, via color = mix(color, uGlassColor, uGlassOpacity). At 0 the glass is completely clear (only distortion/blur apply); at 1 the glass is a solid tint of glassColor. The example uses 0.09 — a very subtle white haze.
grainStrength (default: 0.12)
The amount of animated film-grain / noise added on top, computed as (hash(gl_FragCoord.xy + uTime) - 0.5) * uGrainStrength. It adds a subtle flickering texture that makes the glass feel physical rather than perfectly digital. 0 disables it; the example uses a very light 0.023.
warpStrength (default: 0.12)
The intensity of a smooth, organic warping of the background itself, driven by simplex noise in the background shader: finalUv = aspectUv + uOffset + warpNoise * uWarpStrength. This makes the underlying image gently swirl and undulate before the glass distortion is applied. The example uses 0.15.
gradientSpeed (default: 0.12)
The overall animation speed. It multiplies the elapsed time delta (time += delta * cfg.gradientSpeed) so the drifting cloud/blob motion runs faster or slower, and it also drives how quickly the noise phase advances. Higher = faster-moving background. The example uses 0.37.
cloudDensity (default: 3)
The scale/frequency of the fractal noise (fbm) used to texture the drifting cloud-like shapes. Higher values create more, smaller cloud details; lower values give large, smooth shapes. The example uses 3.2.
cloudSize (default: 0.6)
The radius of the five soft, drifting light blobs that move across the background (smoothstep(R, 0.0, length(...))). Larger values make the glowing areas bigger and cover more of the screen. The example uses 0.68.
rotation (default: 0, in degrees)
The angle of the reeded stripes. The ridges are drawn along a direction computed with cos/sin of this angle, so the whole ribbed-glass pattern can be tilted. The example uses 130 degrees so the stripes run diagonally.
offsetX (default: 0)
Shifts the entire background pattern horizontally. Since it's added directly to the sampling UV (finalUv += uOffset), positive values slide the visual content left. The example uses 0.43 to push the brightest cloud area into view.
offsetY (default: 0)
Same as offsetX but vertically. The example uses -0.12 for a slight downward shift of the content.
motionAngle (default: 0, in degrees)
The direction (in degrees) in which the background clouds drift over time. The shader builds a movement vector from this angle (vec2(cos(uMotionAngle), sin(uMotionAngle))), and the JavaScript advances the noise phase along that vector each frame. The example uses 118 degrees, so the light blobs flow diagonally up-left-ish.
mouseInfluence (default: 0)
How much the background shifts in response to the pointer, from 0 (no interaction) to 1 (full effect). When active, moving the mouse adds up to ±0.2 of offset (the mouse position is smoothly eased toward the target for a fluid, laggy feel). The example uses 1 for maximum parallax response.
bgColor (default: "#00072f")
The base background color that fills the areas between the glowing cloud shapes. The example uses #000000 (pure black) for a dramatic dark canvas.
gradColor1 (default: "#0a0a0c")
The first stop of the gradient used to color the bright clouds. It appears where cloud intensity is low (near the dim edges). The example uses near-black #080808.
gradColor2 (default: "#1f3ed6")
The middle stop of the gradient, at 50% cloud intensity — the transition color between the dark edges and the bright cores. The example uses #000000, keeping the mid-tones dark.
gradColor3 (default: "#f5ebdc")
The final stop of the gradient, applied at the brightest cloud cores. The example uses #ffffff, so the hottest areas of the glow render pure white.
vignette (default: 0.3)
An edge-darkening (or brightening) effect based on distance from the center. Positive values darken the corners (classic vignette); negative values brighten the edges instead. The example uses 1, which creates a strong dark falloff toward the frame's edges.
maxPixelRatio (default: 2)
A performance cap on the render resolution. The canvas is sized as CSS size × min(devicePixelRatio, maxPixelRatio), so on high-DPI screens this prevents the GPU from rendering at excessive resolutions. Lower it (e.g. 1) for better performance on weak hardware; raise it for maximum sharpness on retina displays.
Bonus: the returned API object
The function also returns three methods worth knowing about:
update(options)— merges new options into the config at runtime and redraws.render()— forces a single redraw frame on demand.destroy()— cancels the animation loop, removes all event listeners, and frees the WebGL resources (buffers, textures, programs).
One last note: the code respects the browser's "prefers-reduced-motion" setting — when enabled, animation is frozen and the scene only redraws on resize or pointer movement, which is an accessibility-friendly touch.