Lava sims make life happier

Breaking down the setup

Lava Sim

The emitter is just an angry blob which moves back and forth, the real magic is in the viscous fluid setup.

Turn viscosity and temperature on, these will be needed later (but don’t worry about setting a specific default values, as it will be overriden anyway)

The default temperature will be initialized in/obj/lava_emitter, since it’s a normalised value I just set it to 1 so it can cool towards 0 in the sim.

To achieve a cooling effect I use the gas temperature update node. Note that I have “Map Temperature to Viscosity” enabled, this is where the actual viscosity value range is set and gives the neat ‘hardening’ effect as the fluid cools.

After the sim I just surface it like any fluid, although I do prepare an ’emitcolor’ attribute for the shader (I couldn’t get the look I wanted with a PxrBlackbody shader for reasons I can’t remember, so I hacked it)

Steam Sim

A magma sim wouldn’t feel complete without some steam to show off how hot it is. This was really easy to do!

For convenience I reused the emitcolor from the previous stage, but practically I just blast away any surface geometry that isn’t hot enough, scatter points on it and feed it into a fluid source.

I probably could have improved this so it isn’t emitted along the whole stream of magma, but I only had a day

This post is long enough, so I’ll let you dig into the cocktail umbrella creation yourself 🙂

Scene File

Download the scene file from my patreon: