invisible

view data/shaders/invisible.v.glsl @ 26:61d593076c56

foo
author Eleni Maria Stea <eleni@mutantstargoat.com>
date Sun, 17 Nov 2013 23:02:40 +0200
parents 8b81571dd4dd
children
line source
1 uniform sampler2D depth_tex;
2 varying float mask;
4 void main()
5 {
6 const float threshold = 0.8;
7 const float scale = 5.0;
9 float texel = texture2D(depth_tex, gl_MultiTexCoord0.xy).r;
10 vec4 vpos = gl_Vertex;
11 mask = 1.0 - step(threshold, texel);
12 vpos.z = texel * mask * scale;
14 gl_Position = gl_ModelViewProjectionMatrix * vpos;
15 gl_TexCoord[0] = gl_MultiTexCoord0;
16 }