istereo2

diff sdr/text.p.glsl @ 2:81d35769f546

added the tunnel effect source
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 19 Sep 2015 05:51:51 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sdr/text.p.glsl	Sat Sep 19 05:51:51 2015 +0300
     1.3 @@ -0,0 +1,22 @@
     1.4 +#ifdef GL_ES
     1.5 +precision mediump float;
     1.6 +#endif
     1.7 +
     1.8 +uniform sampler2D tex;
     1.9 +
    1.10 +varying vec4 color;
    1.11 +varying vec3 vpos;
    1.12 +varying vec2 tc;
    1.13 +
    1.14 +void main()
    1.15 +{
    1.16 +	vec4 tcol = texture2D(tex, tc);
    1.17 +
    1.18 +	float fog = exp(-(0.2 * -vpos.z));
    1.19 +
    1.20 +	float alpha = fog * color.a;
    1.21 +
    1.22 +	vec4 color = vec4(1.0, 0.3, 0.2, tcol.x * alpha);
    1.23 +
    1.24 +	gl_FragColor = color;
    1.25 +}