How a Developer Faked Spreading Liquid Foundation with Three.js
Spreading Liquid with Three.js
Misaki Nakano explains how he built the liquid foundation simulation for a Japanese cosmetics site in 2021. A fluid simulation drives a velocity map, which moves a height map representing liquid thickness; a separate alpha map keeps the traces left behind, and normals computed from the height map add highlights via a Matcap texture. He admits the volume isn't conserved — circular strokes keep adding liquid — but the look is what matters.
This method prioritizes visual appearance rather than accurately conserving the amount of liquid.
- andai
This is neat. It doesn't seem to conserve volume. If you spread the blob "inward", all the fluid disappears and you get a tiny thin spot.
That's a general problem I often run into with simulations. When you get it in the opposite direction it can have some very amusing results (e.g. energy in a physical system continues to increase).
- etatester
The conclusion made me sad:
> Publishing this may mean the method is no longer something special.
- lichenwarp
It would be funny if the one that works only with touch gestures left fake fingerprints.
- socalgal2
what is the point of three.js in this demo? It feels like showing me a CSS effect on a DIV and saying "built with React". It's a nice demo. But it's not doing anything that needs a giant library to do.
- brandonpelfrey
This seems useful (after modifications) for building a calligraphy application.