1
0
Fork 0
fgdata/Shaders/shadow-ALS.frag
Erik Hofman 44cabc2eec flug:
* fix the 'slanting shadow > 75 meters' problem
* lay down the shadow flat on the ground

wlbragg:
* add fading effect based o altitude
2017-03-25 09:57:36 +01:00

20 lines
497 B
GLSL

#version 120
uniform sampler2D texture;
uniform float scattering;
varying float alpha_correction;
void main()
{
vec4 texel = texture2D(texture, gl_TexCoord[0].st);
texel.a = smoothstep(0.0,0.1, texel.a);
float illumination = length(gl_Color.rgb);
texel = vec4 (0.1,0.1,0.1,texel.a);
texel.a *= illumination;
texel.a *=0.6 * smoothstep(0.5,0.8,scattering);
texel.a = min(0.8, texel.a);
vec4 fragColor = texel;
gl_FragColor = fragColor * alpha_correction;;
}