Email Me Course Link
Matrix Level-Of-Detail St Coloration Pattern Animation Fire Shader
Home

Shader Writing: Fire


The purpose of this project was to write a surface shader that when used in conjunction with the previously written (water) displacement shader would give a simple object the appearance of being an animated flame. As with the previous assignments, the emphasise was on the vital need to carefully observe and document a natural phenomena before creating a digital version of it.

Reference Footage: Flame Shader:

The reference video above demonstrates what I was initialy aiming for in this my final project. As opposed to a stationary flame, this flame would be moving along a path. I was initially going to attempt a true volumetric flame, but due to unforseen events, my time was cut short in working on this project. I am just going to get as far as I can in completing this project for now. Additionally, our class developed a nice technique to animate a flame on multiple planes with additive colors. This technique is quite effective in creating a volumetric illusion. My flame is very simple at heart, driven by 100 planes. As you can see, this gives nice results with a default shading rate of 1, and it renders fast too. I have added many custom attributes to control key features of the flame.

Custom Attributes:

freq = 4,
begin = 0,
end = .3,
VerticalShear = 1.25,
oxygen = 0.065,
incandecence = 5,
heatClamp = 0.85,
spread = 3,
blur = 0.7;

The main attributes controling the flame above is "oxygen" and "incandescence". Oxygen adds more blue tint to the bottom of the flame, the area of a flame which burns the hottest. Incandecence increases the saturation and glow of the flame's overall color.

 

This flame is controlled by the "heatClamp" attribute, which pushes back some of the blue tint of the flame. The "VerticalShear" attribute is also increased to skew the flame particles vertically.

Anatomy of the Flame Shader

In addition to building the flame itself, it was very important to me that I build custom parameters that give me as much control over the flame as possible. Below I have listed the main parameters controlling the core behaviour of my flame.

a: "Begin" and "End" parameter controlling the ramp which acts as the mask for the flame. These provide a way for me to decrease or increase the boundaries of the ramp, effectively lengthening or shortening the area influenced by the colors, and thus the overall height of the flame itself.

// Remap noise
val = (val - 0.208) * (1/0.67) +(abs(0.50-s)*spread) * (smoothstep(begin, end, 1-t));

b: "heatClamp" parameter controls how much the blue area of the flame is multiplied onto the apparent color of the surface shader. This clamps how much blue is seen through the flame.

color rampColor = smoothstep(begin, end, heatClamp-t);
Ci = Oi * Cs * surfcolor * rampColor * (surfcolor2*oxygen) * (surfcolor3*incandecence); // Flame "color"

c: "oxygen" controls the brightness and overall spread of the blues at the base of the flame.

Ci = Oi * Cs * surfcolor * rampColor * (surfcolor2*oxygen) * (surfcolor3*incandecence); // Flame "color"

d: "spread" widens the overall flame, starting from the base, by multiplying the value of the remap arithmetic.

// Remap noise
val = (val - 0.208) * (1/0.67) +(abs(0.50-s)*spread) * (smoothstep(begin, end, 1-t));

e. "Incandecence" increases overall brightness of the flame.

Ci = Oi * Cs * surfcolor * rampColor * (surfcolor2*oxygen) * (surfcolor3*incandecence); // Flame "color"

f: "VerticalShear" distorts the flame and it's particles by stretching them upwards.

point pp = transform(spacename, P + (s+VerticalShear));

Attributes Tests

These tests were done from directly within cutter.

Zero "Oxygen" animation. "Spread" Animation & High Frequency

 

Strengthening fire by animating almost all of the parameters.
Truthfully, I do not believe in any such thing as a "Final" piece, but I will leave it here for now. I have tweaked my settings here to get a good representation of the flame in my footage. However I may eventually revisit this project to explore ways in which I can animate it along a path.

 

Conclusion to VSFX 319

This project marks the end to my Visual Effects 319 class, Programming Models & Shaders with Malcolm Kesson. I throughly enjoyed the learning experience in this class. Great respect to Malcolm for presenting such abstract material in a very creative way, as well as giving us the freedom to approach these problems in our own way. Every quarter, the boundaries of what was done is exceeded, and it is my hope that we have produced enough material for the class ahead to build upon.

This is the beginning of my shader writing experience, and I will keep posting more shader experiments here. Also, some of the techniques I have created in this class is still in development, and thus I will post full breakdowns once I am completed.

 

 

Matrix
Level-of-Detail
ST Coloration
Maya Pattern Animation
Fire
Links
Links