Drop of Blood: Slow-Motion Fluid & Hemoglobin Optics in WebGPU
Real-time 1000 fps slow-motion WebGPU simulation of whole blood drops in calm water — 512² Stockham FFT capillary precursors, 3-level Multigrid MAC fluid dynamics, 393k Lagrangian RBC parcels, multi-drop vortex leapfrogging, and 380–720 nm Prahl spectral optics.
512² FFT waves · 192×256×192 MAC · 393k RBC parcels · XDR HDR
In 1885, J. J. Thomson and H. F. Newall published hand-drawn studies of liquid drops falling into miscible baths — documenting how surface-tension crater collapse injects circulation that rolls a single falling sphere into an oblate, hollow-cored vortex torus before baroclinic instability splits the ring into secondary curtains and smaller daughter rings.
Drop of Blood simulates that full multiphase and optical cascade in real time at 1000 fps slow motion using raw WebGPU and 31 custom WGSL compute and optical shaders (0 runtime dependencies). Rather than resetting a canned animation, the vessel runs continuously: you can release a single 3.5 mm bead to study clean symmetric roll-up and osmotic hemolysis, or press-and-hold to swell heavier drops across the water and watch multi-drop wave interference and axial vortex leapfrogging unfold.
Coupled multiphase & spectral GPU pipeline
Standard graphics smoke solvers fail on liquid-in-liquid plumes: collocated pressure grids leave odd-even divergence spikes that pinch vortex bottoms into pointed cones, Eulerian grid advection smears millimeter stems into fog, and RGB Beer–Lambert turns thin hemoglobin fringes muddy brown. Every frame instead steps exact dispersive surface waves, staggered MAC multigrid projection, Lagrangian red-blood-cell parcels, and spectral radiative transfer:
Left: exact capillary–gravity dispersion solved in 512 × 512 Fourier space () lets short capillary ripples () outrun the gravity crater. Right: Duysens discrete-cell sieve flattening models hemoglobin packaged inside 8 µm biconcave erythrocytes (Hct ~ 45%) alongside Scott Prahl's 380–720 nm / molar extinction spectra, keeping 3–4 mm aerial cores opaque oxblood (< 0.05% sky transmission) while rendering lysed plasma (concTex.g) as a translucent ruby-rose absorber.
| Pass / Subsystem | Grid / Budget | WGSL Implementation |
|---|---|---|
| 2D Stockham FFT meniscus | 512 × 512 (3.20 m span) | Unitary radix-2 FFT exact phase rotation + viscous damping + circular Rayleigh outer absorber |
| Staggered MAC + Multigrid | 192 × 256 × 192 (~5.0 mm) | Face-centered velocity + 3-level red-black Gauss–Seidel V-cycle + shear-thinning Casson blood viscosity |
| Lagrangian RBC ring buffer | 393,216 parcels (concTex RGBA16F) | Tracks intact erythrocytes (.r), hypotonic lysed plasma (.g), oxygenation/shear (.b), and floor rouleaux bed (.a) |
| Volumetric + Retina raytracer | Half-res + 1:1 Retina + 16× SSAA | 8-tap -cubic B-spline density, Snell's Window & wave-warped TIR, dual-lobe Henyey–Greenstein Mie scatter |
| Apple Silicon XDR swapchain | rgba16float (extended) / bgra8unorm | Piecewise IEC sRGBmidtone parity (Δ <= 0.0033) with unclipped > 1.0 specular headroom on XDR displays |
Single-drop vs. multi-drop physics & macro inspection
- Quick squeeze vs. held Young–Laplace pendant drops: Clicking anywhere on the meniscus squeezes a brisk
3.5 mmbead from the borosilicate Pasteur pipette (y = +0.55). Pressing and holding (0.16–2.2 s) integrates capillary swelling on the glass orifice — changing drop radius, initial osmotic surface lysis, Stokes settling velocity, and vortex circulation. - Wake slipstreaming & vortex leapfrogging: Releasing a second drop above an active submerged torus pulls the trailing plume into the low-pressure downward wake of the first ring, accelerating it straight through the primary core while circular capillary wave trains intersect cleanly across clear water (
0false red meniscus tinting where blood hasn't touched the surface). - Macro
0.24 minspection & paused16×SSAA: Drag to orbit,Shift + drag(or two-finger drag) to pan in 3D, scroll to24 cmmacro focal distance with physical pupil stop-down, pressFto cycle Focus across individual plumes,Lto toggle Backlit vs. Dark Field chiaroscuro lighting, andSpace+.to single-step substeps while progressive16×golden-ratio SSAA converges the frame.