invisible

view data/shaders/invisible.v.glsl @ 24:8b81571dd4dd

fooo
author Eleni Maria Stea <eleni@mutantstargoat.com>
date Sun, 17 Nov 2013 00:15:04 +0200
parents b50ad2711f5f
children 61d593076c56
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 = 4.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 }