vrshoot

diff sdr/level.p.glsl @ 1:e7ca128b8713

looks nice :)
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 00:35:22 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sdr/level.p.glsl	Sun Feb 02 00:35:22 2014 +0200
     1.3 @@ -0,0 +1,14 @@
     1.4 +uniform sampler2D tex;
     1.5 +
     1.6 +varying vec3 vpos;
     1.7 +varying vec2 texcoord;
     1.8 +
     1.9 +void main()
    1.10 +{
    1.11 +	vec4 tex = texture2D(tex, texcoord.xy);
    1.12 +
    1.13 +	float fog = clamp(40.0 / (vpos.z * vpos.z), 0.0, 1.0);
    1.14 +
    1.15 +	gl_FragColor.rgb = tex.rgb * fog;
    1.16 +	gl_FragColor.a = tex.a;
    1.17 +}