custom clipping planes and glsl

How to use custom clipping planes with GLSL ?
i’m setting glClipPlanef(…)
and enable it glEnable(GL_CLIP_PLANE0);
no errors returned - but no effect either :stuck_out_tongue:

in CG there is a special semantic
so i could declare float Clip0Out : CLP0; as vertex output
and set negative value in vertex shader for all vertices that should be clipped.
But i do not see such a thing in glsl
(for cg i use CG_PROFILE_GPU_VP/CG_PROFILE_GPU_FP on nvidia)

GLSL have something like gl_ClipVertex
but outputing eye space coords to this couses driver to crash :stuck_out_tongue:
(there is no difference if clipping planes are enabled or disabled)

BTW. now i’m on Radeon HD 4890 (1GB) - so buggy drivers ? (i have latest :wink:

(or there is no way to use custom clipping planes on ATI under OpenGL ? :))

“in CG there is a special semantic”
in GLSL something similar IRCC:
gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;

and in case of driver crash you should update them. there was an article on how to avoid user clipplanes and utilize your near clipping plane instead.
http://developer.nvidia.com/object/oblique_frustum_clipping.html

well I cannot ‘update them’ couse I have latest publically available :smiley:

I cannot use Oblique Frustum Clipping couse i need to apply my custom clipping plane only to SOME geometry on the scene not on all geometry.
(i need to render terrain and trees without clipping planes, then
set some custom clipping plane to render objects on the left side of the screen only (eyespace.x <= 0.0) (this is just example)).
And olso I need proper zbuffer for future processing …

Well probably i’ll give up with ati for now, and just use
fragment shader clip and pass clipping value to fragment shader by myself.