This article explains how the author built a liquid-spreading foundation effect in three.js, originally made for a 2021 cosmetics promo. It reuses the velocity map from an earlier Stable Fluids article and adds a height map FBO to represent liquid thickness, updated each frame via backtraced advection. An alpha map records a historical maximum to keep visible traces after liquid thins out. Surface normals are computed from the height map in the fragment shader and rendered with a Matcap texture. The author notes the simulation isn't volume-conserving, and bonus demos compare 8-bit versus 32-bit texture precision and mix three colored liquids using a simplified Kubelka-Munk model.
Spreading Liquid with Three.
Computer Science and Programming
@computer_science_and_programmingChannel specialized for advanced topics of: * Artificial intelligence, * Machine Learning, * Deep Learning, * Computer Vision, * Data Science * Python Admin: @otchebuch Memes: @memes_programming Ads: @Source_Ads, https://telega.io/c/computer_science
138,642 מנויים
פתח בטלגרם Spreading Liquid with Three.js
