diff --git a/src/gl/scene/gl_drawinfo.cpp b/src/gl/scene/gl_drawinfo.cpp index 4dba1a2a0..72e0c8d1d 100644 --- a/src/gl/scene/gl_drawinfo.cpp +++ b/src/gl/scene/gl_drawinfo.cpp @@ -767,11 +767,11 @@ void GLDrawList::DrawSorted() sorted=DoSort(SortNodes[SortNodeStart]); } gl_RenderState.ClearClipSplit(); + glEnable(GL_CLIP_DISTANCE1); glEnable(GL_CLIP_DISTANCE2); - glEnable(GL_CLIP_DISTANCE3); DoDrawSorted(sorted); + glDisable(GL_CLIP_DISTANCE1); glDisable(GL_CLIP_DISTANCE2); - glDisable(GL_CLIP_DISTANCE3); gl_RenderState.ClearClipSplit(); } diff --git a/wadsrc/static/shaders/glsl/main.vp b/wadsrc/static/shaders/glsl/main.vp index 0aef2d35a..827644eea 100644 --- a/wadsrc/static/shaders/glsl/main.vp +++ b/wadsrc/static/shaders/glsl/main.vp @@ -54,6 +54,6 @@ void main() gl_ClipDistance[0] = uClipHeightTop - worldcoord.y; } - gl_ClipDistance[2] = worldcoord.y - uClipSplit.x; - gl_ClipDistance[3] = uClipSplit.y - worldcoord.y; + gl_ClipDistance[1] = worldcoord.y - uClipSplit.x; + gl_ClipDistance[2] = uClipSplit.y - worldcoord.y; }