Fluid Simulation in Bottles


This was a fairly old project but i migrated it into this project to implement new changes. I found a blog post by Simon Trumpler about Boomer bile/puke flask in Left 4 Dead 2 game: https://simonschreibt.de/gat/left-4-dead-2-puke/ This used Rigging and animation to simulate fluid in bottls. He also explores how other artists have made fluid simulation in bottles, the one by Tyler was very interesting.

I also found a twitter post by Joyce [MinionsArt] where someone used this same technique but added a Sine movement to it: https://twitter.com/minionsart/status/986374665399685121 Even though it was designed for Unity Game Engine, it was really easy to understand the script when combined with Tyler's Fluid simulation. It did require experimenting with the Start Preview node in UE4.

Fluid Simulation in a bottle UE4


This actually gave me the idea of adding UV distortion to the material to create my own version of  fluid simulation in a bottle. I world aligned the bubbles and added foam at the top by experimenting. Again as before I made sure it was very customisable.

The fluid is actually a bottle mesh duplicated inside and not actual fluid inside. I made 2 variations of fluid in a bottle. One is translucent and the other is masked. The masked version has a 2-sided material to it but doesnt have transparency. However the translucent material cannot have 2-sided materials as it will come up with artifacts. This gave me the idea to have another layer of the bottle liquid mesh facing inwards to overcome the 2-sided transparency limitation.

Masked and Translucent Liquid Modelling Method Diagram

The problem with the translucent version is that it can't cast shadows where as masked version can. They also both don't have accurate shadow information. Therefore casting shadows was disabled to save on performance.

Masked material setup
Translucent material setup


Comments

Popular posts from this blog

Environment Showcase Concepts

Distance Field water foam

World alignment (Tri-planar mapping)