A pointer-driven cloud
The homepage mist is a fluid-style field in WebGL2. A swipe carries the noise instead of tinting the spot under the cursor.
The band along the bottom of the homepage is a fluid-style mist in the spirit of the aave.com/app hero. It is an original shader, in that spirit: Aave's field is lilac and keeps mottling while it sits still. This one is the site's cyan, and it stays quiet until a pointer moves.
The simulation is src/components/PointerWave/index.tsx. The dial defaults live in src/dials/useCloudDials.ts, and src/dials/CloudDialRoot.tsx is what leaves a small button on the live site. src/components/Articles/index.tsx paints the canvas in the same grid cell as the footer. src/app/page.tsx only lost pb-24 on <main>.
The mist
PointerWave, the homepage component, with the dials left off. The slow drift is the noise phase.
Three pictures that missed
The first version was a blurred CSS wash. From across the room it read as mist. A pointer crossing it changed nothing, because nothing in the picture was a field.
A still gradient
The dot is the pointer. The wash stays where it was painted.
The next pass was one WebGL draw that pulled a lighter lobe toward the cursor. The noise under the rest of the band never moved. A tint glued to the pointer is a spotlight.
A lobe under the cursor
Color follows the pointer. The wash around it does not travel.
The fluid solver came next, turned up. Force was 6000, push was 0.0036, intensity was 1, and the pointer stir added 18 instead of 2.4. Alpha ran from 0.28 to 0.92, so a swipe went nearly solid in the darks and opened the white page in the lights. That reads as a saturated smear with a streak cut through it.
The pass that shipped lowers those three numbers, pulls the stir down, and keeps a tint in every pixel. A swipe then displaces the wash. Both canvases run the same solver. The left one is that earlier recipe.
Loud, then quiet
force 6000, push 0.0036, intensity 1
force 4200, push 0.002, intensity 0.64
Scripted stroke, same path. Left is the pre-soften recipe. Right is what shipped.
A stroke writes into a velocity buffer
The canvas is WebGL2. Velocity is stored in an RGBA16F texture, so the context asks for EXT_color_buffer_float. The simulation grid is 128 pixels tall, and at most 512 wide. A pointer stroke splats force along the segment it just traveled, in up to 24 steps, so a fast swipe stays a line instead of a dotted gap. Touch pointers return immediately and write nothing.
float falloff = exp(-dot(d, d) / u_radius);
vec2 flow = texture(u_base, uv).xy + u_amount * falloff;
const steps = Math.min(24, Math.max(1, Math.ceil(Math.min(dist, cap) / 0.008)));The picture is that buffer, drawn as ink. White is still. Cyan is speed. The stroke is scripted here so the field keeps moving while you read. On the homepage the same splat waits for a real pointer, and the canvas itself has pointer-events: none. The page listens on window.
The velocity buffer
Half-float velocity. The trail fades because each advect step multiplies by decay 0.99.
Curl, then take the divergence out
Curl is a finite difference of the neighbors. Vorticity confinement adds a push along that spin, with u_curlStrength at 3.5, so the trail rolls instead of blooming into a blob.
Curl
The curl buffer during the same kind of stroke. Spin shows up as ink.
A velocity field that only splats will converge and pile the cloud up. The next pass is a short projection. Measure divergence, solve pressure with four Jacobi iterations, then subtract the pressure gradient.
// PRESSURE_STEPS is 4
fragColor = vec4((left + right + down + up - div) * 0.25, 0.0, 0.0, 1.0);
vec2 flow = texture(u_flow, uv).xy - vec2(right - left, up - down) * 0.5;The divergence buffer below is what that solve sees while the stroke is on the field.
Divergence
Divergence spikes along the stroke, then the projection takes it back out.
After the projection, the velocity advects itself and decays. u_dt is 1/60. u_decay defaults to 0.99, which is why a swipe lingers and then leaves.
vec2 sampleAt = uv - u_dt * flow * u_texel;
fragColor = u_decay * texture(u_source, sampleAt);Sample the noise upstream of the flow
The color is four octaves of value noise. The sample point is shoved by the velocity before that noise runs, which is the whole trick. The pattern travels with the swipe. With push at 0 the velocity buffer is invisible, and the band only drifts.
// Sample upstream so the pattern travels with the flow.
p -= flow * u_push;u_push defaults to 0.002. The mist is pale, so that small offset is easy to miss on the cloud itself. The grids below are the same offset, p -= flow * u_push, drawn as lines. A slow phase blend (u_drift 0.09) keeps the resting field from freezing. The shade ramp is wide on purpose, smoothstep(0.2, 0.82, …). A tight ramp is what turns a swipe into a hard edge.
Push
push 0
push 0.002
Same velocity. Left push is 0, so the stroke never bends the grid. Right is the homepage push.
Blur it, and keep a tint in every pixel
The color pass draws into a texture. A 5-tap blur follows, horizontal into a second texture, then vertical onto the screen. The radius defaults to 18.
blurPass(colorA, colorB, 1, 0);
blurPass(colorB, null, 0, 1);Two passes
blur 0
blur 18
The louder recipe, so the radius is easy to see. The homepage runs this same blur at 18 on the quiet mist.
Alpha stays low, and the color mix never lets a pixel go clear. The page behind the canvas is white, so a hole in the alpha reads as a white streak. The shipped mix keeps some of the light tint everywhere, and only a little of the deep accent at the brightest noise.
vec3 col = mix(u_light, u_mid, 0.18 + shade * 0.48);
col = mix(col, u_deep, smoothstep(0.78, 1.0, shade) * 0.1);
float alpha = fade * mix(0.36, 0.52, shade) * u_intensity;The colors are the page's colors
readBrandColors resolves three custom properties with getComputedStyle. A custom property can sit as oklch(…) until something paints it, so the helper sets color on a probe and reads the used value back.
deep: cssVarToHex("--color-accent-text"),
light: cssVarToHex("--color-accent-light"),
mid: cssVarToHex("--color-accent"),The hex in DEFAULT_PARAMS is only the stand-in before that read. The dials start from the resolved colors. CloudDialRoot renders DialRoot with productionEnabled and defaultOpen false. The root layout already mounts DialKit in development, so this root mounts only in production, and it leaves a small button on the live site.
The canvas stays out of the way
prefers-reduced-motion: reduce paints one frame and skips the loop. These demos do the same: a scripted stroke is baked into that still frame, then the clock stops. The homepage paints its single frame at time zero, with no baked stroke. Touch is ignored. requestAnimationFrame runs only while the canvas intersects the viewport and the tab is visible.
The footer and the canvas share a grid cell. A footer in normal flow paints after the canvas in that cell, so z-index on the canvas alone cannot slip it behind. The link below sits in that second cell. The canvas does not take the click.
One grid cell
Newsletter
Get the newsletterSame structure as the homepage footer. The link is in the cell above the canvas.
Push it
This canvas listens to itself, because it is meant to be touched with a pointer. A scripted stroke keeps running until the pointer enters, then your movement is the force. Touch still does nothing, same as the homepage. Leave the canvas and the script picks the stroke back up.
The shipped cloud
Move a mouse or trackpad across the mist. Touch is ignored.
Newsletter
Stay updated with my latest articles and projects. No spam, no nonsense.