uniform vec4 HG_DepthRange; uniform sampler2D HG_Texture0; uniform sampler2D HG_Texture1; varying vec3 normal; varying vec3 pos; varying vec3 gpos; void main() { vec4 IM = texture2D( HG_Texture0, gl_TexCoord[0].xy ); if( IM.a < 0.5 ) discard; IM.a = 1.0; IM.g = IM.b = IM.r; // IM.rgb *= gl_Color.rgb; vec3 rpos = gl_LightSource[0].position.xyz - gpos; vec3 ln = normalize( rpos ); float dotv = dot( ln, normal ); float intensity = 1./pow( length( rpos ), 0.2 ); IM.rgb*= pow(dotv,2.) * intensity * 1.; gl_FragColor = IM * 1.5 - 0.1; }