New effect family "Fluido": real-time GPU fluid simulation (ink-in-water)

Stable-fluids solver (fluid.js) on ping-pong half-float framebuffers:
semi-Lagrangian advection, vorticity confinement (clamped — unbounded
confinement overflows half-float and kills the field), 22 Jacobi pressure
iterations, audio-driven dye/force splats. Three wandering emitters inject
palette-coloured dye (brightness-normalized so dark palette entries stay
vivid); bass drives injection and stirring, beats fire directional bursts,
treble adds swirl. Universal modifiers map onto the sim: warp = vorticity,
speed = sim speed (brightness is speed-normalized), sym = kaleidoscope with
a wedge that rotates via rotSpeed, contrast/invert on display.

The Visualizer delegates to FluidSim when the preset has isFluid (flag is
always present so Object.assign merges can't leave it stale). 102 new
presets (17 palettes x 6 variants).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
lucianoandClaude Fable 5 committed 2026-07-17 14:48:38 +02:00
1 parent 7a79ade428
commit 14afe0b98c
4 files changed
+409 -2

No files matched your search

+6 -2
View File
@@ -33,7 +33,8 @@ const FAMILIES = [
{ name: 'Tri-Banda', scale: 1.0, bgDark: true },
{ name: 'Reattivo Bassi', scale: 1.0, bgDark: true },
{ name: 'Reattivo Medi', scale: 1.0, bgDark: true },
{ name: 'Reattivo Alti', scale: 1.0, bgDark: true }
{ name: 'Reattivo Alti', scale: 1.0, bgDark: true },
{ name: 'Fluido', scale: 1.0, fluid: true } // GPU fluid sim (fluid.js), not the uber-shader
];
// Palettes: low colour (a) -> high colour (b), plus optional hue-cycle/sat.
@@ -88,7 +89,10 @@ function makeEffect(fi, pi, vi) {
speed: v.speed,
colorA: pal.a,
colorB: pal.b,
bgDark: fam.bgDark ? 1 : 0
bgDark: fam.bgDark ? 1 : 0,
// Always present (0/1) so Object.assign merges in setEffect can't leave a
// stale flag behind when switching between fluid and shader presets.
isFluid: fam.fluid ? 1 : 0
};
}