VERTEX
varying float z;
void main()
{

	z =  (gl_ModelViewMatrix * gl_Vertex).z;
	gl_Position = ftransform(); 


}
PIXEL
varying float z;
uniform float shadow_range;
uniform float shadow_start;
void main()
{
	float r=1.0 - clamp(abs(z)*shadow_range - shadow_start,0.0,1.0);
	int g = int(256.0*r);
	gl_FragColor =  vec4(r,r*256.0-float(g),0.0,0.0);
}
