Projects

Numerical simulation / Graphics / C

09 / 09

gooey

An interactive CPU fluid experiment in C using diffusion, pressure projection, semi-Lagrangian advection, and real-time D3D11 visualization.

StatusRecovered experiment
PeriodRecovered 2026
Built withC / Fluid simulation / D3D11
Colorful density moving through the interactive gooey fluid simulation.
01 / In operation

Mouse input injects density and velocity into a 128 × 128 CPU grid; D3D11 presents the evolving field.

02 / Intent

gooey began as an experiment in turning a set of numerical operations into something immediate and tactile. Density provides the visible material, while the velocity field carries it through the grid.

The implementation is intentionally compact. Rather than hiding the solver behind an engine, the project keeps diffusion, projection, advection, interaction, and rendering close enough to trace as one complete loop.

03 / Architecture

Each frame advances the same fixed grid through a short solver pipeline before converting density into display pixels.

01

Injection

Mouse movement deposits weighted density and velocity into nearby cells.

02

Diffusion

Iterative neighbor solves spread density and velocity according to diffusion and viscosity parameters.

03

Projection

Computes divergence, iteratively solves pressure, and subtracts its gradient from velocity.

04

Advection

Backtraces through velocity and uses bilinear interpolation to move both velocity and visible density.

04 / Engineering decisions

01

Fixed fields, explicit passes

Density, velocity, pressure, divergence, and working values live in fixed arrays. Each solver stage operates directly on those fields, making the order of simulation work unambiguous.

02

Sample the flow backward

Semi-Lagrangian advection traces each destination cell backward through the velocity field and bilinearly samples the previous state, producing stable interactive motion with a straightforward implementation.

03

Keep simulation and display separate

The CPU solver owns scalar density and vector velocity. Rendering only maps density through a color lookup and updates a texture, keeping graphics concerns out of the numerical operations.

05 / Current reality

gooey is a recovered visual experiment rather than a validated computational-fluid-dynamics tool. It runs on a 128 × 128 CPU grid with periodic boundaries, fixed iteration counts, and parameters chosen for interaction and appearance rather than measured physical accuracy.