• Advertisement
Sign in to follow this  

glsl and clipping plane

This topic is 3951 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a simple raycaster in glsl but wish to add the ability to move the camera into the volume. This requires information about the clipping plane (specifically the near clipping plane) inside the fragment shader. Is there any way I can grab information regarding the clipping planes inside the shader? I know there's a gl_ClipPlane[gl_MaxClipPlanes] however I have been unable to figure out what exactly it stores nor how to use it. More specifically I need to figure out if the near clipping plane is inside the volume and if it is change the starting point for the ray from the vertex to the near clipping plane. Any help would be appreciated. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You can write the Near-Plane into one of the OpenGL hardware Clipping Planes, and then read it out in the Shader. Or you get the Near Clipping plane out of the Projeciton Matrix in the shader.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement