diff --git a/wadsrc/static/shaders/glsl/main.vp b/wadsrc/static/shaders/glsl/main.vp index cea479f3b..44aec6199 100644 --- a/wadsrc/static/shaders/glsl/main.vp +++ b/wadsrc/static/shaders/glsl/main.vp @@ -50,16 +50,18 @@ void main() gl_Position = ProjectionMatrix * eyeCoordPos; - // clip planes used for reflective flats - if (uClipHeightBottom > -65536.0) - { - gl_ClipDistance[0] = worldcoord.y - uClipHeightBottom; - } - else if (uClipHeightTop < 65536.0) - { - gl_ClipDistance[0] = uClipHeightTop - worldcoord.y; - } + #if defined __GLSL_CG_DATA_TYPES && defined GLSL12_COMPATIBILE + gl_ClipVertex = eyeCoordPos; + #endif + + // clip planes used for reflective flats + if (uClipHeightDirection != 0.0) + { + gl_ClipDistance[0] = (worldcoord.y - uClipHeight) * uClipHeightDirection; + } + + // clip planes used for translucency splitting gl_ClipDistance[1] = worldcoord.y - uClipSplit.x; gl_ClipDistance[2] = uClipSplit.y - worldcoord.y; diff --git a/wadsrc/static/shaders/glsl/shaderdefs.i b/wadsrc/static/shaders/glsl/shaderdefs.i index d49034973..5259bb5fd 100644 --- a/wadsrc/static/shaders/glsl/shaderdefs.i +++ b/wadsrc/static/shaders/glsl/shaderdefs.i @@ -6,7 +6,7 @@ precision highp float; uniform vec4 uCameraPos; uniform int uTextureMode; -uniform float uClipHeightTop, uClipHeightBottom; +uniform float uClipHeight, uClipHeightDirection; uniform vec2 uClipSplit; uniform float uAlphaThreshold;