View Full Version : glClipPlane very slow

08-16-2002, 08:47 AM
Do you know why glClipPlane is so slow on a Geforce3 ?

My display without glClipePlane 200fps
The same with glClipPlane 40 fps ??

08-16-2002, 09:49 AM
Yes. Unfortunately, geometric clip planes are not supported on nvidia hardware. You have to use a texture to do your clipping. There is a demo of this in their Effects Browser.

I believe you can get up to four clip planes with a single texture unit, though, so it's not THAT bad.

-- Zeno

08-16-2002, 01:03 PM
Thank you for your reply.

But how can I do if I haven't "GL_NV_texture_shader" ??

08-16-2002, 01:20 PM
But how can I do if I haven't "GL_NV_texture_shader" ??

Well, you DO have that if you have a Geforce3, no? Otherwise, you can always clip your triangles/polygons in software. That's how I've been solving the problem when I can't sacrifice texture units. The algorithm isn't very complicated.

-- Zeno

08-16-2002, 02:18 PM
How to get two per-pixel clipping planes by spending a single texture unit:

Use a 2x2 alpha texture that's all opaque in the lower-left corner, and all transparent in the other three pixels.

Then set up world space texgen for this texture to map clipped-out geometry (two planes: s and t) to the transparent parts.

Then turn on alpha test.

08-17-2002, 12:12 PM
...and use GL_NEAREST filtering, I would have thought?