Smoke material

For smoke and dust I wanted a material with a billowing effect and control over animation speed, tiling and the like. Since flip books don’t scale up well frame rate or resolution wise I chose a different approach.

Smoke puff Smoke material Smoke material Smoke00

First I made a simple smoke-like texture in Filter Forge by combining cellular noises. The filter put the grayscale image to the blue channel while its derivatives to the red and green.

The smoke noise Smoke material Smoke material Smoke01
The smoke texture with derivatives Smoke material Smoke material Smoke02

The slopes in R and G are used to distort the texture: At the beginning the distortion amount multiplier is a negative value so bright areas are pinched, pushed smaller. As the animation progresses the multiplier interpolates to positive values, that’s when the bright areas expand. Smaller bumps in the grayscale image produce coffee bean like artifacts toward the end which are not that visible in the final material but I still want to address them in the future.

The base billowing effect Smoke material Smoke material Smoke03

The obvious problem at this point was that the animation was not looping seamlessly. A simple solution was to produce a another animation and blend between the two in a way that snapping back to the beginning is never visible. The second animation uses the same input texture but the UVs are 90 degrees rotated and 0.5 units offset on both axes.

Blending between two animations Smoke material Smoke material Smoke04

Then the effect looped without snapping but the same two states showed up over and over. To fix that I used a noise texture to add a random offset to the generated UVs. The two animations have their own random value which changes every time they snap back to the beginning.
(If using a texture for noise is not an option then any simpler method for generating a random-ish number should work fine. The smoke texture is random enough to make it hard to see the relation between offset positions.)

Blending between randomized animations Smoke material Smoke material Smoke05

The next step was tweaking the incoming time values which control the animation. By adding the mix of a radial gradient and the smoke texture to the output of the time node I could make the animation radiate from the center.

Animating by adjusted time values Smoke material Smoke material Smoke06

This fancy time also changed how the alpha values controlled the interpolation between the two billowing animations. The shape is static but that is fine, not apparent with all the other things going on.

The blend mask for the animations Smoke material Smoke material Smoke07

And with that the core of the effect was done.

The finished core billowing effect Smoke material Smoke material Smoke08

The rest of the features were trivial to implement: transparency, a fiery core, particle parameters controlling tiling, contrast and so on.

Fireball Smoke material Smoke material Smoke09
Explosion Smoke material Smoke material Smoke10

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /home/zoltanec/public_html/pages/wp-includes/functions.php on line 4552

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /home/zoltanec/public_html/pages/wp-includes/functions.php on line 4552