Jump to content

  • Log In with Google      Sign In   
  • Create Account


clipping plane with shader


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 amtri   Members   -  Reputation: 175

Like
0Likes
Like

Posted 27 February 2014 - 01:05 PM

Hello,

 

I have clipping planes working in my shader using gl_ClipDistance. I pass the equation of every clipping plane to my vertex shader and compute the dot product with my untransformed coordinates. It works fine.

 

Now I ran into a machine where the call

 

glGetString (GL_SHADING_LANGUAGE_VERSION)

 

returns 130. Yet, gl_ClipDistance is an undefined variable. This brings up my first question:

 

1) Shouldn't gl_ClipDistance always be defined for GLSL version 130? I'm using a Linux 64-bit machine with glew 1.10.0.

 

But I want to get this working, so I decided to alternatively use gl_ClipVertex instead on that machine. The problem is I'm getting no image - kind of like everything is always being clipped out. Given that my glClipPlane is setting the plane equation in untransformed coordinates (i.e., same as gl_Vertex), I'm simply setting gl_ClipVertex = gl_Vertex.

 

In my gl_ClipDistance implementation I'm taking the dot product of gl_Vertex with the 4 numbers that define the equation in glClipPlane. It works fine. But somehow I think my clipping plane equations are not being properly passed down. I even tried setting "#version 120" in the shader, but with no effect.

 

Can anybody shed some light onto this?

 

Thanks.



Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS