Dev writes a blood shader for a 2003 game port, accidentally building a small optics department

banteg · x · 2026-10-20

Developer banteg wrote a blood shader for his port of the 2003 game Crimsonland and ended up implementing a small optics department: Beer–Lambert absorption, Fresnel reflections, separate soil and liquid normals, volume-weighted coagulation, and HDR beam reflections.

The core insight: deriving normals from a blood decal's alpha channel gives every splatter a tiny cliff — "embossed ketchup." So he split the surfaces: soil/corpse normals handle diffuse lighting with no blood bevel, while a separate smoothed liquid normal handles reflections. Blood becomes an optical layer over wet ground — light passes through, hits the substrate, passes back, and wavelength-dependent absorption eats green and blue first; deeper pools swallow more of the remaining red.

Each splatter carries its own age: freshness decays exponentially with a 45-second time constant weighted by deposited volume, so a fresh drop can't rejuvenate an old puddle. Blood darkens and roughens over time, weapon reflections spread and fade, and passing beams act as finite light sources whose highlights push past SDR white into EDR. The demo shows one splatter coagulating from fresh → 15s → 45s → 180s.

Original post →

More from Fun

Fun channel →