View Full Version : Problems with gl_ClipVertex

04-25-2005, 09:03 AM
I'm trying to use the user clipping planes with a vertex&fragment GLSL program, but it doesn't work.
I have read that you only have to set the gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
and that's all, of course, you have to set the clipping planes with glClipPlane (..) and activate it glEnable(GL_CLIP..).

Thanks in advance

05-09-2005, 08:17 PM
Hello! I have the same problem as u...r u testing in ATI or NVIDIA boards? In ATI it works fine, even not specifying the clip vertex...but in NVIDIA...im waiting for a miracle to get it working...if u find any solution please email me
See ya!

05-10-2005, 01:35 PM
The current public NVIDIA drivers do not support the gl_ClipVertex output, this will work in Release 75 (75.80 and later) drivers.

As a workaround, you can write to the gl_ClipCoord output:

vec4 clipVertex = gl_ModelViewMatrix * gl_Vertex;
for (int i = 0; i < 6; i++)
gl_ClipCoord[i] = dot(clipVertex, gl_ClipPlane[i]);which is supported in current drivers.