is there a way to visualize the clip planes sent to opengl? i had reflections working perfectly, but now, after i’ve re-organized my shaders, the user clip planes don’t work correctly anymore.
it doesn’t seem to be possible to query the planes using glGet(), but what i actually need are the transformed, post-vs, planes anyway.
i compute a reflection matrix from from the plane equation given by the mirror’s normal (= abc) and the dot product of this normal and the mirror’s center (= d). i then multiply this matrix with the current view matrix. finally, i pass the plane equation to glClipPlane and render.
It depends on what space your clip planes are in. Keep in mind that the clip planes are automatically transformed to eye-space when you specify them, so what your modelview matrix is at that point matters. I think the most straight-forward approach is to use clip-space planes, then you can simply do gl_ClipVertex = gl_Position.
yeah that was the problem! i didn’t know that the clip planes are transformed by the view matrix, so it was just luck that the correct matrix was present when i set the planes thanks!