The purpose of this project was to write a surface shader that when used
in conjunction with a water-like 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.
This project was a quick run through a lot of new RSL concepts and features, so I'll probably be revising this section in the future. Below is an overview of my basic fire shader.
Reference
another view
Breakdown
Here is the main funtion of the code, which, as I will explain, combines several color functions into the main fire shader:
Oi = ((smoothstep(rim_width, 1 , dot)) - (opac_ramp));
Ci = Oi * Cs * (surfcolor + opac_ramp) * Kfb;
"Oi" or opacity, is created by subtracting a vertical ramp from a normal-based ramp.
ramp based on surface nornals
vertical spline ramp
combined opacity
"Ci" or color, is created by adding a color spline ramp to a ramp for brightness
color spline ramp
brightness spline ramp
addition of color ramps
The result is close to what I was looking for, but I was not carefull about correctly adding, subtracting, and multiplying colors in my shader in order to get the most acurate end result. This is something that needs later revision.