View Full Version : Clipping planes with Cg

01-12-2004, 04:46 AM
Hi, I have a problem with using a clipping plane in conjunction with Cg. When I enable the Cg profiles the clipping plane stops working! I recall something about needing special texture shader instructions for a clipping plane to work ("cull_fragment", I think), but I'm not sure how to enable this from Cg. Anyone else have an idea?

- Richard

01-13-2004, 09:37 PM

Tom Nuydens
01-13-2004, 10:28 PM
I'll move this thread to the shading language forum, where you might get an answer. Next time however, please post Cg questions to www.cgshaders.org. (http://www.cgshaders.org.)

-- Tom

01-14-2004, 09:45 AM
I believe user clip planes are subsumed by ARB_FRAGMENT_PROGRAM, which means that you have to implement them yourself if you use a fragment shader, either explicitly (by binding a fragment program) or implicitly (by having CG do it for you).

AFAICR, the KIL instruction is used to implement clipping planes.

01-14-2004, 12:32 PM
User clip planes don't have any interaction with ARBfp.

They should Just Work.

They're *not* supported in ARBvp except in position_invariant mode.


02-01-2004, 11:04 PM
I 've resolved this problem on NVidia cards by changing vertex shader with fixed pipeline.Pixel shader work ok with clipplane.So the problem maybe in conflict clipplane implementation with vertex shader.

Paul Sernine
03-02-2004, 11:00 PM
Originally posted by cass:

They're *not* supported in ARBvp except in position_invariant mode.
Well, that's what is specified.
That is true with NVidia.
But, AFAIK, it works with ATi, even without the position_invariant option.
As far as I remember DX shaders have a "phase" keyword to explicitely define the portion of code that change the position of the vertex. The "clipping phase" may be "inserted" there.
http://www.opengl.org/discussion_boards/ubb/rolleyes.gif So is it API limited or hardware limited ?