On 12/7/2011 11:36 AM, Dave Jones wrote:
According to the glClipPlane docs, the plane equations are transformed to view 
space.

This is only applicable if you want to perform clipping in the same space as the OpenGL FFP. Once you start using shaders, this is optional, and you can perform clipping in some other space if it's more convenient. It's up to you.

In my shader, I'm passing the plane equations in as uniforms. For this to work 
on all vertices, I need to ensure that the clip plane equations have been 
transformed by the inverse transpose of the model view matrix. The only way 
that I can think of doing that is creating a uniform update callback which 
always updates the plane equations based on the camera's current model view 
matrix.

If you're using a GLSL 1.20 shader, your shader would just multiply the clip plane by the built-in uniform gl_ModelViewMatrixInverseTranspose.
   -Paul




_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to