From 5b7826f68b8f97fd7161e79f4e35783135c09b99 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Jan 2023 09:21:01 +0100 Subject: [PATCH] - set lightblendmode to 0 when setting up a 2D viewpoint. 2D never uses dynamic lights so this should always be 0 - and eliminates another place in the backend referencing game data. --- src/common/rendering/hwrenderer/data/hw_viewpointbuffer.cpp | 3 +-- wadsrc/static/shaders/glsl/main.vp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/rendering/hwrenderer/data/hw_viewpointbuffer.cpp b/src/common/rendering/hwrenderer/data/hw_viewpointbuffer.cpp index 3a9d23d9a8..3d67b46be8 100644 --- a/src/common/rendering/hwrenderer/data/hw_viewpointbuffer.cpp +++ b/src/common/rendering/hwrenderer/data/hw_viewpointbuffer.cpp @@ -30,7 +30,6 @@ #include "hw_renderstate.h" #include "hw_viewpointbuffer.h" #include "hw_cvars.h" -#include "g_levellocals.h" static const int INITIAL_BUFFER_SIZE = 100; // 100 viewpoints per frame should nearly always be enough @@ -92,7 +91,7 @@ void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height, int pll) matrices.mPalLightLevels = pll; matrices.mClipLine.X = -10000000.0f; matrices.mShadowmapFilter = gl_shadowmap_filter; - matrices.mLightBlendMode = (level.info ? (int)level.info->lightblendmode : 0); + matrices.mLightBlendMode = 0; matrices.mProjectionMatrix.ortho(0, (float)width, (float)height, 0, -1.0f, 1.0f); matrices.CalcDependencies(); diff --git a/wadsrc/static/shaders/glsl/main.vp b/wadsrc/static/shaders/glsl/main.vp index 49da024ac6..f718d73bc8 100644 --- a/wadsrc/static/shaders/glsl/main.vp +++ b/wadsrc/static/shaders/glsl/main.vp @@ -87,7 +87,7 @@ void main() gradientdist.y = worldcoord.y - bottomatpoint; gradientdist.z = clamp(gradientdist.x / (topatpoint - bottomatpoint), 0.0, 1.0); } - + if (uSplitBottomPlane.z != 0.0) { ClipDistance3 = ((uSplitTopPlane.w + uSplitTopPlane.x * worldcoord.x + uSplitTopPlane.y * worldcoord.z) * uSplitTopPlane.z) - worldcoord.y;