Blood is cool (post process)
leaves 0.0 for sure

leaves 0.001 guramteed

It is still being worked on, the wishlist includes:
1) perspective (blood splats far away go down slower)
2) feed in decal data (position) so pixels too far away are not processed
3) take camera rotation into account when defining the Y/down vector
Code: Select all
// simple fragment shader
// 'time' contains seconds since the program was linked.
uniform sampler2D tex;
uniform sampler2D tex2;
uniform sampler2D normalm;
uniform int currentframe;
uniform vec4 color;
void main()
{
float CF = 1.0/(currentframe*2.0-1.0);/*
if (currentframe==2) CF = 0.5;
else if (currentframe==3) CF = 0.33333;*/
float thickness = texture2D(tex,gl_TexCoord[0].xy).r*CF;
float temp_thick;
int i;
vec3 textureNM = texture2D(normalm,gl_TexCoord[0].xy).xyz;
vec2 normal = (vec2(textureNM.x,abs(textureNM.z+textureNM.x))-0.5)/128.0;
vec2 texcoord = gl_TexCoord[0].xy;
for (i=0; i<currentframe; i++) {
texcoord -= normal;
temp_thick = texture2D(tex,texcoord).r;
thickness += temp_thick*i*CF;
//normal = (texture2D(normalm,texcoord).xz-0.5)/256.0;
if (texcoord.y<0.0||(normal.x==0.0&&normal.y==0.0)) break;
}
gl_FragColor = mix(texture2D(tex2,gl_TexCoord[0].xy),color,min(1.0,thickness));
}
glass shader with faked reflections or a double refraction (simulate double glaze) as you might call it ++ lighting

I SHALL POST THE CODE SOON