eleni@23: uniform sampler2D depth_tex; eleni@24: varying float mask; eleni@23: eleni@23: void main() eleni@23: { eleni@24: const float threshold = 0.8; eleni@24: const float scale = 4.0; eleni@24: eleni@24: float texel = texture2D(depth_tex, gl_MultiTexCoord0.xy).r; eleni@23: vec4 vpos = gl_Vertex; eleni@24: mask = 1.0 - step(threshold, texel); eleni@24: vpos.z = texel * mask * scale; eleni@23: eleni@23: gl_Position = gl_ModelViewProjectionMatrix * vpos; eleni@23: gl_TexCoord[0] = gl_MultiTexCoord0; eleni@23: }