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.
More from Fun
- Character.AI Files for Bankruptcy, Sells Assets to Disney for $20M — menhguin · 2026-10-20
- Singapore newspaper headline accidentally promises 3,000-year-long internships — ProfChesterman · 2026-10-20
- AI vibecoded co-op mod wows gamers, evoking Kaillera dial-up nostalgia — Promptmethus · 2026-10-20
- Skyrim AI mod built from scratch: autonomous NPCs that sense your gaze and generate songs — ReignMocap · 2026-10-20
- A Neat Definition of UX: Compress Information to Its Local Minimum Before It Becomes Lossy — wavefnx · 2026-10-20
- AI Circle Joke: Humans Are Just 'Reality Tokenizers' Doing Data Annotation for LLMs — ducha_aiki · 2026-10-20