View Full Version : Using gl_ClipVertex in GLSL

04-06-2005, 08:27 AM
Hi; Im performing culling sometimes when using my GLSL shader, so i should fill the
gl_ClipVertex with a value...is it the same as gl_Position? if i fill it when i do not enable clip planes, does it generate an error or something? when i just put
gl_ClipVertex = gl_Position;
the fps went to 1fps...thanks!

04-06-2005, 03:37 PM
Writing gl_ClipVertex shouldn't generate any error when it's not used, though of course it can reduce performance to do unneccesary work. As for performance, the situation is a bit bad here. You can simply choose not to write gl_ClipVertex and it will just work, on ATI cards at least. I believe the same is true on nVidia but I'm not entirely 100%. It's undefined behavior though with regards to the spec. If you write gl_ClipVertex as you're supposed to do, the driver has to figure out whether it's a linear transformation and whether it can use hardware to perform the clip, which current drivers don't (or at least didn't last time I checked) and thus gives you software.

04-06-2005, 07:20 PM
Thats what i got...in my ATI board, the clipping works even without using gl_ClipVertex...but in NVIDIA not...and i think its falling back to softwate when i put gl_ClipVertex = gl_Position;
maybe somebody can help me in NVIDIA boards...thanks Humus!!

04-12-2005, 07:37 PM
Does anybody at least had used vertex program with clipping planes, in NV boards? How do u got it working?