PDA

View Full Version : vertex program + clipping ???



A027298
09-12-2003, 10:46 PM
Hi,

I need to have additional clipping planes in my application. I do certain vertex transformations in a vertex program (ARB). I read in the spec that user defined clip planes can be found in 'state.clip[n].plane' for GL_CLIP_PLANEn. But how can I peform clippling against that plane then? I read issue 20 of the spec. But somehow I still don't quite understand how to do it now. Does anyone know something about that?

Thanks!

Eric Lengyel
09-12-2003, 11:16 PM
You can't. Vertex programs neither create nor destroy vertices, and topological information is not available.

You might want to check out NV version 2.0 vertex programs. They allow you to calculate arbitrary user clipping plane signed distances per vertex. The drawback is that they only work on NV30+ hardware -- ATI does not support it.

jwatte
09-13-2003, 06:47 AM
You can "easily" fake clipping planes by either forwarding a clipping distance and using KIL in the fragment program, or, if you don't have a fragment program, forward a texture coordinate which maps to a transparent or opaque texel with NEAREST filtering, and use alpha testing.

A027298
09-14-2003, 10:02 PM
Thanks for the reply guys. I'm gonna check it out.