fire shader project


this project shows the usage on RSL and MTOR to create a flame animation>

______________________________________________________________________________________________________________________________

 

 

 

 

 

eraser(float Kd = 1,
base = 0.43,
baseBlend = 0.28,
baseOp = 0.05,
topOp = 1.3;

color baseC = (0, 0, 1),
topC = (1, .6, 0); )
{
color diffusecolor,
surfcolor = 1, surfopac = Os;
normal n = normalize(N);
normal nf = faceforward(n, I);

float amount = smoothstep(base - baseBlend, base, t);
Oi = mix(baseOp, topOp, amount);

surfcolor = mix(baseC , topC, amount);

Character walk cycle rendered with my eraser shader via MTOR

 

 

____________________________________________________________________________________________________________________

 

Render of candle using the flame shader in MTOR

surface
candle(float Kd = 1,
blend = 0.1,
base = 0.5,
rimwidth = .5,
basecolor = .3,
baseO = .4,
colorcolor = .5,
topO = 1,
basecolor = color (0,0,1),
topcolor = 1;)
{
color diffusecolor,
surfcolor = 1, surfopac = Os;
normal n = normalize(N);
normal nf = faceforward(n, I);

float ob = smoothstep(baseO - blend, baseO, t);
color baseopacity = mix(baseO, topO, ob);

Oi= nf.normalize(-I);

float cb = smoothstep(basecolor - blend, basecolor, t);
surfcolor = mix(basecolor, topcolor, cb);
diffusecolor = Kd * diffuse(nf);

Ci = Oi * Cs * surfcolor * diffusecolor;
}

____________________________________________________________________________________________________________________