top of page

100% MATHEMATICALLY CORRECT FIRE

WHAT IS FIRE?

Fire, at least in our case, is straight up something that emits light and has a density. It has a hot core and cooler tips, and it has volume: licks in front, licks behind.

That's true for a campfire, and it's true for whatever magical flame you're asked to make. Stylized doesn't ignore any of this. It just points the same data at a different palette.

EmberGen already gives us all of that. Not as "fire", but as data. And it exports way more channels than we usually use. FlameMask, Luminance, Temperature, Depth… these are data textures, and each one can drive a different part of the material.

So let's go through them.


R — "THERE IS FIRE HERE"
Using the EmberGen colour scheme, R is where fire is most prominent. The problem is that it pushes a lot of detail towards flat 1, and once that detail is written as 1 you can't get it back. You just get blobs.
It depends a lot on the sim: how much fuel ignites, and how much temperature is lost in the first couple of cm from the source. If your R keeps its detail, great, use it. Just don't let it hit full white or full black.

LUMINANCE — "SOMETHING IS EMITTING LIGHT HERE"
Instead of saying "there is fire in this space", Luminance says "I see something emitting light here". Same coverage as R, but it keeps the detail R burns out.
More fire = more light = more data to work with in the editor.
That said, don't use only Luminance. It gives you body, general motion and a bit of detail, not everything.

FLAMEMASK — THE BODY
FlameMask and R can end up very close to each other, and that's fine, because FlameMask's job is the body.
It's not binary: the core sits at 1, but the ethereal parts fade through grey. Run it through a Power with a parameter and those parts drop out, leaving an almost hard-edged silhouette. That becomes our opacity.

LRF.jpg

G AND B — THE PUSH DETAILS
In a red/orange sim, G and B are still coming out, just hiding under R. Those are our push details.
B is the one doing the work here. The amount of sheer character you get from it is crazy. It's added on top of the colour curve rather than through it, so it reads as raw light layered over the palette: crisp tongues and tendrils that sit above the gradient. Step it and you get strong, sharp shapes.
G isn't used in this material, but it's worth keeping in mind. It carries the same kind of fine structure as B, so it could drive a second detail layer, break up the opacity edge, or distort the other textures. Free data, already computed, waiting for a job.

GB.jpg

TEMPERATURE — THE FIRST COLOUR LAYER
Temperature in a stylized game might sound ridiculous, but it's our best ally.
IRL it's temperature that moves the air around flames and pushes the licks higher. In the material it simply slides the colour curve: hotter core, and licks that burn brighter even as they move away.

On its own it looks flat. That's normal, it's supposed to. It's the base, and the real detail comes from Luminance and the other channels.

It can do more than colour, too. Drive IOR with it for smooth refractions without another layer, or use it to distort the texture. Running it a couple of frames behind the other textures gives a nice oomph: the flames get bigger, then the air around them warms up.

FLAMEDEPTH — VOLUME FOR ALMOST FREE
Probably one of the most common channels in CGI. It costs almost nothing and still gives you details to play with.
When multiple sprites spawn, Depth adds more distance between the licks, and that alone is enough to stop the flames looking like flat boards.
Push it further and you get bold, stylized shapes. Then you'll need another channel for the detail: back to G or B.

Temp.jpg

ONE GRAPH, THREE FIRES

Every fire in the opening shot is the same material. Same channels, same chain, same textures. Only a handful of parameters change per instance, and these are the ones that matter.

EDGES
The power applied to both FlameMask and Depth. Below 1 it lifts the soft greys, so the licks stay tall and the ethereal parts survive. Above 1 it crushes them to zero, carving the flame into crisp, graphic shapes. Same texture, painterly or cut-out, one slider.

STYLE
Blends between two ways of building the body: Luminance plus FlameMask on one side, Depth on the other. It isn't clamped, and that's the fun part. Push it past the ends and it stops blending and starts exaggerating. Negative values thicken the body and pull the layered depth out of it, giving a dense, compact fire.

EMISSIVE
The material doesn't know what light it's standing in, so this is the dial for whoever places it. A stylized palette needs it low, or the tonemapper bleaches it back towards white. A realistic fire can take more.

THE CURVE
The purple fire isn't a hue shift. It's a different colour curve plugged into the exact same graph. Same heat data, pointed at a different palette.

Exempli.jpg

APPENDIX: GRAB THE GRAPH

Want to take it apart yourself? Send me a private message and I'll share the full material and MF_MultiFlipbook, the flipbook function that samples LGB and DepthFlameTemp with motion vectors.

Paste the MF into an empty Material Function and save it first, then paste the material, so it finds the function.

What's not included: the textures and the Curve Atlas. Plug in your own EmberGen exports, packed as:

→ LGB: Luminance · G · B
→ DepthFlameTemp: Depth · FlameMask · Temperature
→ Motion Vectors

The graph doesn't care what fire you feed it.

Setup used in the opening shot: the two realistic fires are Additive, Default Lit. The purple one is Translucent.

Fish.png

Bonus points if your graph ends up looking like a little fish

bottom of page