gl_ClipPlane

Hi all,

I’m trying to update an old demo of mine, and I have switched alot of my rendering over to GLSL. My problem is that in order to get clipping planes to work, I have to use gl_ClipPlane in my shader. Now I can get this to work. But if I try to render when I am not using a clip plane, my shader doesn’t draw correctly.

I am trying to do reflections, so I have to render my scene, once upside down, and once normally, but I don’t want to clip the normal version, and I need the shader to make the reflection look like the original (lighting, etc).

Would the best way to do this, be putting an ‘if’ statement in my vertex shader and send a uniform variable stating whether clipping is enabled or not?

Or could something else be going wrong (I’ve recently switched to Ubuntu from Windows, maybe a driver issue?)?

Thanks,
Swiftless

What’s your hw?

Btw, looks like clipvertex and clipplanes have been deprecated in favor of clipdistance in 3.0 - the idea being to declare and manage your own clip planes then simply set each vert’s distance to the planes manually, thereby eliminating some extra bookkeeping cruft in the API.

I’m using an Nvidia Geforce 9500GT on one machine, and an Nvidia Geforce 8800GTS on the other. Both have the same issue.

Might look into that if I can’t get this working or do get this working and want to do more :stuck_out_tongue:

Hey,

I switched the gl_ClipPlane call to gl_ClipVertex and all is working well :smiley:

Thanks!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.