Magical Flame

This project is for creating flame. There are number of ways to create flame in CG.
Particles and fluids are the two good example for making flames. But this project is
focusing on
surface shader and simple geometry to make realistic CG flame.
Personally I am very interested in gaming CG that is believable but has style.
Reference Movies:
To make flame, the reference images or footages were essential element for this project.
Speed, Richness, Color, Textures and Characteristic of movement are the aspects that i had to catch to create
believable CG flame. Even though the fire i will make will be stylize, it is still necessary to make the flame believable.
So the stack of planes would give me the volume for the fires.
CODE :: stackOfPlanes.py

After the stack of plane was made, I started with the noise(P) in surface shader.
Since (P) has xyz value, by using noise (P) i was able to create different patterns and movements by using just one surface shader.
Even though i only have one surface shader that is applied to multiple planes,
i was able to
create volume illusion and different patterns for each plane because (P) has different xyz value for each plane.
float val = noise(pp * freq);
val = val + (noise(pp * freq * 2) - 0.5)/2;
By adding noise on to noise, i could make the characteristeric of flame much realistic.

I was possible to create solarization effect by multiplying two smoothstep values and makes the Oi = Os * opacity;.
Because it is made by adding colors, it gives very natural looking fire.
After adding noise and making the planes additive Oi, i made the flame to have the shape of the flame.

by cutting the cone using the method of calculating the distance of micropolygons, i could make stack of plane shaped like cone.
distance that is calculated from the (P) was used in the method.
by making Oi related to the t value, i could achieve the shape of cone.
Oi = Oi * (1 - smoothstep(minRadius * t, maxRadius * t, d));
This shape code also provide the control of xshift and zshift to create natural movement of the flame.
it is possible to control the tip of the flame to move around just like real flames do.

After this was done i tryed something else.
by adding Abs value to the remapping noise value, i could achieve the look of flame different way.

//Remap noise
val = (val - 0.208) * (1/0.67) + abs (1-s * spread);
if(val < 0)
val = 0;
This is the movie for adding abs to the coneCutshape flame: