- another failed attempt to use GL_CLIP_PLANE. Leave it in because it's closer to what is needed than the old code.

This commit is contained in:
Christoph Oelckers 2016-05-12 23:41:06 +02:00
parent 616f84209b
commit 99bfc64af6

View file

@ -342,21 +342,28 @@ void FRenderState::SetClipHeight(float height, float direction)
{ {
mClipHeight = height; mClipHeight = height;
mClipHeightDirection = direction; mClipHeightDirection = direction;
#if 1
// This still doesn't work... :(
if (gl.glslversion < 1.3f) return;
#endif
if (direction != 0.f) if (direction != 0.f)
{ {
if (gl.glslversion >= 1.3f) glEnable(GL_CLIP_DISTANCE0); /*
else if (gl.glslversion < 1.3f)
{ {
// This does not work. Need someone who understands how glClipPlane works... glMatrixMode(GL_MODELVIEW);
//glEnable(GL_CLIP_PLANE0); glPushMatrix();
glLoadMatrixf(mViewMatrix.get());
// Plane mirrors never are slopes. // Plane mirrors never are slopes.
//double d[4] = { 0, direction, 0, -direction * height }; double d[4] = { 0, direction, 0, -direction * height };
//glClipPlane(GL_CLIP_PLANE0, d); glClipPlane(GL_CLIP_PLANE0, d);
glPopMatrix();
} }
*/
glEnable(GL_CLIP_DISTANCE0);
} }
else else
{ {
if (gl.glslversion >= 1.3f) glDisable(GL_CLIP_DISTANCE0); glDisable(GL_CLIP_DISTANCE0); // GL_CLIP_PLANE0 is the same value so no need to make a distinction
//else glDisable(GL_CLIP_PLANE0);
} }
} }