Skip to content

Commit

Permalink
- set lightblendmode to 0 when setting up a 2D viewpoint.
Browse files Browse the repository at this point in the history
2D never uses dynamic lights so this should always be 0 - and eliminates another place in the backend referencing game data.
  • Loading branch information
coelckers committed Jan 15, 2023
1 parent 34e2e77 commit 5b7826f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/common/rendering/hwrenderer/data/hw_viewpointbuffer.cpp
Expand Up @@ -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

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/shaders/glsl/main.vp
Expand Up @@ -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;
Expand Down

0 comments on commit 5b7826f

Please sign in to comment.