0001: //
0002: // This program creates the fire effect.
0003: //
0004: 
0005: fragout main(vf20 I
0006:             , uniform sampler2D tex0
0007:             , uniform sampler2D tex1
0008:             , uniform sampler2D tex2
0009: ) {
0010:     fragout O;   
0011: 
0012:     float4 LastResult = uclamp(tex2D(tex0)
0013:             - float4(0.15, 0.15, 0.15, 0.0f));
0014:     float4 NewPoint   = tex2D(tex1);
0015:     float4 Fire       = tex2D(tex2);
0016: 
0017:     O.col = Fire * NewPoint + LastResult;
0018: 
0019:   return O;
0020: } 
0021: