Found a WebGL fluid sim and replaced the mouse with a music analyser: the bass note is where the ink enters, dissonance sets the vorticity, and a closing low-pass turns the pool to syrup
I found Pavel Dobryakov's WebGL-Fluid-Simulation last week — PavelDoGreat/WebGL-Fluid-Simulation — the one where you drag your mouse through a pool of ink and it swirls. It's MIT, it's lovely, and under it is an ordinary Stam stable-fluids step: splat a force and some dye into the velocity field, vorticity confinement, divergence, 20 Jacobi sweeps for pressure, project, advect. (His is itself after GPU Gems ch. 38, Harris 2004, and Stam's 1999 paper.)
So I wired my music analyser in where the mouse used to be. The solver is his and essentially unchanged; what I added is the grammar that turns audio features into splats, and that part was written with Claude.
The rule I tried to stick to is one musical element, one channel, so that you can point at something on screen and name what made it:
- The bass note is where the ink enters. A persistent emitter near the floor, whose x is the sub's pitch class laid around the circle of fifths — so the inlet walks sideways as the bassline moves — and whose y is the bass register (a 35 Hz sub sits low, a 140 Hz mid-bass sits higher). A lower sub opens a wider mouth.
- The kick lifts it. One upward impulse from the floor at the inlet's x, at twice the splat radius.
- The snare shears it. Two opposing lateral impulses at mid height, one pushing right from x = 0.3 and one pushing left from x = 0.7. That is the pinch you see tearing the middle of the pool in half.
- The hats are droplets, falling from the surface at y = 0.9.
- The beat kneads it. A body force on the whole pool, −0.35·cos⁴(π·beatPhase), so the field breathes once per beat instead of pulsing on an envelope.
- The mid band is a floor of ink — pads, chords and vocals enter as continuous dye at mid height with no velocity at all, so the pool shows the music's level from the first second and the drum hits land in ink that is already there.
- The drop clears the pool. One big impulse up at four times the radius, and the dye dissipation jumps to 12 for exactly one beat — which keeps about 1 % of the ink 0.4 s later. At 6 it kept 10 % and the pool still read as full.
Those are all pushes. The two I like more are the ones that change the medium instead.
A closing low-pass is what makes it viscous. The viscosity term here is velocity dissipation:
velDiss = 0.2 + 2.8·smoothstep(0.80, 0.97, lpSweep) + 2·hush
lpSweep is how shut the filter is: energy in 5–12 kHz over energy in 150 Hz–2.5 kHz, smoothed a quarter second, divided by that track's own p90 of the same ratio over the last 30 seconds, and flipped. So it is never an absolute brightness — it is "the highs are gone compared to how bright this track gets", which is the only version that survives a whole library. The knee matters as much as the term: nothing happens until the filter is 80 % shut against the track's own ceiling, and then it ramps hard. Filter open, velDiss 0.2, and an eddy keeps its momentum for seconds. Filter shut, 3.0, and every eddy dies in about a third of a second — the ink goes thick and the whole picture crawls. hush, the pre-drop silence, adds up to 2 more on top, so the bar before a drop is the slowest the fluid ever gets.
Dissonance sets the curl. The vorticity confinement gain is 10 + 40·tension, where tension is sensory roughness — beating between partials that are too close together — normalised to the p10/p98 of roughness over the last 30 seconds. A consonant passage runs nearly laminar at 10; a rough bar runs at 50 and the ink shreds into eddies. This is the one I'd defend hardest, because it's where the physics and the music turn out to mean the same thing: roughness is partials fighting each other, and curl is the field fighting itself. I didn't design that correspondence, I just stopped fighting it.
Three things I'd rather say than have someone find out, since all three would be cooler if they were otherwise:
There is no fluid in the audio analysis. The sound isn't solving anything. Three dozen scalar features come off an FFT and a pitch tracker each frame, and they set uniforms and splat parameters. The Navier-Stokes is strictly downstream and knows nothing about music.
Nothing here is a neural net. No model anywhere in the render path — it's a pressure solve and a fragment shader. The code was written with Claude, which I don't think is what rule 3 is aimed at, but I'd rather state it than be coy about it.
It isn't reactive-random. There's no RNG and no clock read in the whole grammar; the hat droplets' x is hash(beatCount·7 + i, seed). The same audio gives byte-identical frames, which is how it's regression-tested — md5s of rendered frames at fixed windows across seven real tracks, so a refactor that was meant to be a no-op has to prove it was one.
It runs in a browser tab and listens to whatever you already have playing in another tab; nothing is uploaded.
retinarave.com
and the source is at
tbkraf08/RetinaRave
🎵 "Raindrops on Roses" by An-Ten-Nae & Dimond Saints — not my track, all rights to the artists.
20 points · 4 comments
Fluid Wallpaper 1.0.0
Fluid Wallpaper 1.0.0
Fluid Wallpaper
Screenshot
Watch the overview video in full quality
An animated, interactive fluid simulation rendered on the GPU behind your
desktop icons. The shaders are a Direct3D port of
WebGL Fluid Simulation
by Pavel Dobryakov (MIT license).
Features
- One independent simulation per monitor, drawn behind the desktop icons.
- Autonomous color trails and periodic color bursts keep the fluid moving.
- Moving the mouse over the desktop stirs the fluid. No clicks are needed and
no mouse hooks are installed; clicks always reach the desktop.
- Bloom, sun rays and shading effects, all configurable.
- Pauses automatically when the desktop can't be seen: when a monitor's
desktop is fully covered by windows (maximized, full-screen or several
windows side by side), when the session is locked or switched away, and when
the display is turned off.
- Optional lower frame rate or pause on battery power and Energy Saver.
To see the wallpaper, minimize your windows. Settings are applied live;
changing a setting restarts the simulation.
How it works
Each monitor gets a child window of Explorer's wallpaper host, without a
redirection surface. The simulation runs in Direct3D 11 and its final pass is
drawn straight into a DirectComposition swap chain attached to that window.
Frames never leave the GPU. The same path is used on the classic desktop
layout and on the Windows 11 24H2+ layout.
The mod doesn't change your wallpaper settings, the registry or the order of
Explorer's own windows. Disabling it removes its windows and reveals your
normal wallpaper.
Performance tips
- Lighter: Maximum FPS 30, Dye resolution 512, Trails 2, Bloom off.
- Swirlier: Vorticity 50, Dye dissipation 60, Trail force 4500.
Troubleshooting
If the wallpaper doesn't appear, open the mod log in Windhawk: the lines
starting with "Desktop layout", "Direct3D" and "Monitor" describe what was
found and created. Please include them when reporting a problem, together with
your Windows build number.
If the animation stays frozen while the desktop is visible, a window that
looks hidden is probably reported as visible and covering it. Disable Pause
when the desktop is covered in that case.
Requirements and limitations
- Windows 10 or 11 and a GPU with Direct3D feature level 10.0 or later.
- Relies on the undocumented WorkerW desktop layout of Windows, which differs
between Windows 10, Windows 11 and Windows 11 24H2 and later. Future Windows
builds may change it.
- Below 30 FPS (including the battery option) the motion also slows down,
because each simulation step is limited in length to stay stable.
- The transparent background and screenshot features of the web demo are not
included.
- Some settings use integer scales; for example, 80 means 0.8.
11 points · 1 comment
Fluid Wallpaper
Fluid Wallpaper
preview.redd.it
Watch the overview video in full quality
An animated, interactive fluid simulation rendered on the GPU behind your desktop icons. The shaders are a Direct3D port of WebGL Fluid Simulation by Pavel Dobryakov (MIT license).
Features
- One independent simulation per monitor, drawn behind the desktop icons.
- Autonomous color trails and periodic color bursts keep the fluid moving.
- Moving the mouse over the desktop stirs the fluid. No clicks are needed and no mouse hooks are installed; clicks always reach the desktop.
- Bloom, sun rays and shading effects, all configurable.
- Pauses automatically when the desktop can't be seen: when a monitor's desktop is fully covered by windows (maximized, full-screen or several windows side by side), when the session is locked or switched away, and when the display is turned off.
- Optional lower frame rate or pause on battery power and Energy Saver.
To see the wallpaper, minimize your windows. Settings are applied live; changing a setting restarts the simulation.
How it works
Each monitor gets a child window of Explorer's wallpaper host, without a redirection surface. The simulation runs in Direct3D 11 and its final pass is drawn straight into a DirectComposition swap chain attached to that window. Frames never leave the GPU. The same path is used on the classic desktop layout and on the Windows 11 24H2+ layout.
The mod doesn't change your wallpaper settings, the registry or the order of Explorer's own windows. Disabling it removes its windows and reveals your normal wallpaper.
Performance tips
- Lighter: Maximum FPS 30, Dye resolution 512, Trails 2, Bloom off.
- Swirlier: Vorticity 50, Dye dissipation 60, Trail force 4500.
Troubleshooting
If the wallpaper doesn't appear, open the mod log in Windhawk: the lines starting with "Desktop layout", "Direct3D" and "Monitor" describe what was found and created. Please include them when reporting a problem, together with your Windows build number.
If the animation stays frozen while the desktop is visible, a window that looks hidden is probably reported as visible and covering it. Disable Pause when the desktop is covered in that case.
Requirements and limitations
- Windows 10 or 11 and a GPU with Direct3D feature level 10.0 or later.
- Relies on the undocumented WorkerW desktop layout of Windows, which differs between Windows 10, Windows 11 and Windows 11 24H2 and later. Future Windows builds may change it.
- Below 30 FPS (including the battery option) the motion also slows down, because each simulation step is limited in length to stay stable.
- The transparent background and screenshot features of the web demo are not included.
- Some settings use integer scales; for example, 80 means 0.8.
18 points · 3 comments
Mentions
Found a WebGL fluid sim and replaced the mouse with a music analyser: the bass note is where the ink enters, dissonance sets the vorticity, and a closing low-pass turns the pool to syrup I found Pavel Dobryakov's WebGL-Fluid-Simulation last week — PavelDoGreat/WebGL-Fluid-Simulation — the one where you drag your mouse through a pool of ink and it swirls. It's MIT, it's lovely, and under it is an ordinary Stam stable-fluids step: splat a force and some dye into the velocity field, vorticity confinement, divergence, 20 Jacobi sweeps for pressure, project, advect. (His is itself after GPU Gems ch. 38, Harris 2004, and Stam's 1999 paper.) So I wired my music analyser in where the mouse used to be. The solver is his and essentially unchanged; what I added is the grammar that turns audio features into splats, and that part was written with Claude. The rule I tried to stick to is one musical element, one channel, so that you can point at something on screen and name what made it: - The bass note is where the ink enters. A persistent emitter near the floor, whose x is the sub's pitch class laid around the circle of fifths — so the inlet walks sideways as the bassline moves — and whose y is the bass register (a 35 Hz sub sits low, a 140 Hz mid-bass sits higher). A lower sub opens a wider mouth. - The kick lifts it. One upward impulse from the floor at the inlet's x, at twice the splat radius. - The snare shears it. Two opposing lateral impulses at mid height, one pushing right from x = 0.3 and one pushing left from x = 0.7. That is the pinch you see tearing the middle of the pool in half. - The hats are droplets, falling from the surface at y = 0.9. - The beat kneads it. A body force on the whole pool, −0.35·cos⁴(π·beatPhase), so the field breathes once per beat instead of pulsing on an envelope. - The mid band is a floor of ink — pads, chords and vocals enter as continuous dye at mid height with no velocity at all, so the pool shows the music's level from the first second and the drum hits land in ink that is already there. - The drop clears the pool. One big impulse up at four times the radius, and the dye dissipation jumps to 12 for exactly one beat — which keeps about 1 % of the ink 0.4 s later. At 6 it kept 10 % and the pool still read as full. Those are all pushes. The two I like more are the ones that change the medium instead. A closing low-pass is what makes it viscous. The viscosity term here is velocity dissipation: velDiss = 0.2 + 2.8·smoothstep(0.80, 0.97, lpSweep) + 2·hush lpSweep is how shut the filter is: energy in 5–12 kHz over energy in 150 Hz–2.5 kHz, smoothed a quarter second, divided by that track's own p90 of the same ratio over the last 30 seconds, and flipped. So it is never an absolute brightness — it is "the highs are gone compared to how bright this track gets", which is the only version that survives a whole library. The knee matters as much as the term: nothing happens until the filter is 80 % shut against the track's own ceiling, and then it ramps hard. Filter open, velDiss 0.2, and an eddy keeps its momentum for seconds. Filter shut, 3.0, and every eddy dies in about a third of a second — the ink goes thick and the whole picture crawls. hush, the pre-drop silence, adds up to 2 more on top, so the bar before a drop is the slowest the fluid ever gets. Dissonance sets the curl. The vorticity confinement gain is 10 + 40·tension, where tension is sensory roughness — beating between partials that are too close together — normalised to the p10/p98 of roughness over the last 30 seconds. A consonant passage runs nearly laminar at 10; a rough bar runs at 50 and the ink shreds into eddies. This is the one I'd defend hardest, because it's where the physics and the music turn out to mean the same thing: roughness is partials fighting each other, and curl is the field fighting itself. I didn't design that correspondence, I just stopped fighting it. Three things I'd rather say than have someone find out, since all three would be cooler if they were otherwise: There is no fluid in the audio analysis. The sound isn't solving anything. Three dozen scalar features come off an FFT and a pitch tracker each frame, and they set uniforms and splat parameters. The Navier-Stokes is strictly downstream and knows nothing about music. Nothing here is a neural net. No model anywhere in the render path — it's a pressure solve and a fragment shader. The code was written with Claude, which I don't think is what rule 3 is aimed at, but I'd rather state it than be coy about it. It isn't reactive-random. There's no RNG and no clock read in the whole grammar; the hat droplets' x is hash(beatCount·7 + i, seed). The same audio gives byte-identical frames, which is how it's regression-tested — md5s of rendered frames at fixed windows across seven real tracks, so a refactor that was meant to be a no-op has to prove it was one. It runs in a browser tab and listens to whatever you already have playing in another tab; nothing is uploaded. retinarave.com and the source is at tbkraf08/RetinaRave 🎵 "Raindrops on Roses" by An-Ten-Nae & Dimond Saints — not my track, all rights to the artists.
Fluid Wallpaper 1.0.0 Fluid Wallpaper 1.0.0 Fluid Wallpaper Screenshot Watch the overview video in full quality An animated, interactive fluid simulation rendered on the GPU behind your desktop icons. The shaders are a Direct3D port of WebGL Fluid Simulation by Pavel Dobryakov (MIT license). Features - One independent simulation per monitor, drawn behind the desktop icons. - Autonomous color trails and periodic color bursts keep the fluid moving. - Moving the mouse over the desktop stirs the fluid. No clicks are needed and no mouse hooks are installed; clicks always reach the desktop. - Bloom, sun rays and shading effects, all configurable. - Pauses automatically when the desktop can't be seen: when a monitor's desktop is fully covered by windows (maximized, full-screen or several windows side by side), when the session is locked or switched away, and when the display is turned off. - Optional lower frame rate or pause on battery power and Energy Saver. To see the wallpaper, minimize your windows. Settings are applied live; changing a setting restarts the simulation. How it works Each monitor gets a child window of Explorer's wallpaper host, without a redirection surface. The simulation runs in Direct3D 11 and its final pass is drawn straight into a DirectComposition swap chain attached to that window. Frames never leave the GPU. The same path is used on the classic desktop layout and on the Windows 11 24H2+ layout. The mod doesn't change your wallpaper settings, the registry or the order of Explorer's own windows. Disabling it removes its windows and reveals your normal wallpaper. Performance tips - Lighter: Maximum FPS 30, Dye resolution 512, Trails 2, Bloom off. - Swirlier: Vorticity 50, Dye dissipation 60, Trail force 4500. Troubleshooting If the wallpaper doesn't appear, open the mod log in Windhawk: the lines starting with "Desktop layout", "Direct3D" and "Monitor" describe what was found and created. Please include them when reporting a problem, together with your Windows build number. If the animation stays frozen while the desktop is visible, a window that looks hidden is probably reported as visible and covering it. Disable Pause when the desktop is covered in that case. Requirements and limitations - Windows 10 or 11 and a GPU with Direct3D feature level 10.0 or later. - Relies on the undocumented WorkerW desktop layout of Windows, which differs between Windows 10, Windows 11 and Windows 11 24H2 and later. Future Windows builds may change it. - Below 30 FPS (including the battery option) the motion also slows down, because each simulation step is limited in length to stay stable. - The transparent background and screenshot features of the web demo are not included. - Some settings use integer scales; for example, 80 means 0.8.
Fluid Wallpaper Fluid Wallpaper preview.redd.it Watch the overview video in full quality An animated, interactive fluid simulation rendered on the GPU behind your desktop icons. The shaders are a Direct3D port of WebGL Fluid Simulation by Pavel Dobryakov (MIT license). Features - One independent simulation per monitor, drawn behind the desktop icons. - Autonomous color trails and periodic color bursts keep the fluid moving. - Moving the mouse over the desktop stirs the fluid. No clicks are needed and no mouse hooks are installed; clicks always reach the desktop. - Bloom, sun rays and shading effects, all configurable. - Pauses automatically when the desktop can't be seen: when a monitor's desktop is fully covered by windows (maximized, full-screen or several windows side by side), when the session is locked or switched away, and when the display is turned off. - Optional lower frame rate or pause on battery power and Energy Saver. To see the wallpaper, minimize your windows. Settings are applied live; changing a setting restarts the simulation. How it works Each monitor gets a child window of Explorer's wallpaper host, without a redirection surface. The simulation runs in Direct3D 11 and its final pass is drawn straight into a DirectComposition swap chain attached to that window. Frames never leave the GPU. The same path is used on the classic desktop layout and on the Windows 11 24H2+ layout. The mod doesn't change your wallpaper settings, the registry or the order of Explorer's own windows. Disabling it removes its windows and reveals your normal wallpaper. Performance tips - Lighter: Maximum FPS 30, Dye resolution 512, Trails 2, Bloom off. - Swirlier: Vorticity 50, Dye dissipation 60, Trail force 4500. Troubleshooting If the wallpaper doesn't appear, open the mod log in Windhawk: the lines starting with "Desktop layout", "Direct3D" and "Monitor" describe what was found and created. Please include them when reporting a problem, together with your Windows build number. If the animation stays frozen while the desktop is visible, a window that looks hidden is probably reported as visible and covering it. Disable Pause when the desktop is covered in that case. Requirements and limitations - Windows 10 or 11 and a GPU with Direct3D feature level 10.0 or later. - Relies on the undocumented WorkerW desktop layout of Windows, which differs between Windows 10, Windows 11 and Windows 11 24H2 and later. Future Windows builds may change it. - Below 30 FPS (including the battery option) the motion also slows down, because each simulation step is limited in length to stay stable. - The transparent background and screenshot features of the web demo are not included. - Some settings use integer scales; for example, 80 means 0.8.