invisible
annotate 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 |
rev | line source |
---|---|
eleni@23 | 1 uniform sampler2D depth_tex; |
eleni@24 | 2 varying float mask; |
eleni@23 | 3 |
eleni@23 | 4 void main() |
eleni@23 | 5 { |
eleni@24 | 6 const float threshold = 0.8; |
eleni@26 | 7 const float scale = 5.0; |
eleni@24 | 8 |
eleni@24 | 9 float texel = texture2D(depth_tex, gl_MultiTexCoord0.xy).r; |
eleni@23 | 10 vec4 vpos = gl_Vertex; |
eleni@24 | 11 mask = 1.0 - step(threshold, texel); |
eleni@24 | 12 vpos.z = texel * mask * scale; |
eleni@23 | 13 |
eleni@23 | 14 gl_Position = gl_ModelViewProjectionMatrix * vpos; |
eleni@23 | 15 gl_TexCoord[0] = gl_MultiTexCoord0; |
eleni@23 | 16 } |