Fix wrong blend tables used when dynamic lights hits translucent lines

This commit is contained in:
Magnus Norddahl 2019-12-31 03:00:36 +01:00
parent 2b05bfed68
commit 839b737429
4 changed files with 14 additions and 14 deletions

View file

@ -344,15 +344,7 @@ namespace swrenderer
void DrawWall(const WallDrawerArgs &args) override { Queue->Push<DrawWall1PalCommand>(args); }
void DrawWallMasked(const WallDrawerArgs &args) override { Queue->Push<DrawWallMasked1PalCommand>(args); }
void DrawWallAdd(const WallDrawerArgs &args) override
{
if (!args.lightlist)
Queue->Push<DrawWallAdd1PalCommand>(args);
else
Queue->Push<DrawWallAddClamp1PalCommand>(args);
}
void DrawWallAdd(const WallDrawerArgs &args) override { Queue->Push<DrawWallAdd1PalCommand>(args); }
void DrawWallAddClamp(const WallDrawerArgs &args) override { Queue->Push<DrawWallAddClamp1PalCommand>(args); }
void DrawWallSubClamp(const WallDrawerArgs &args) override { Queue->Push<DrawWallSubClamp1PalCommand>(args); }
void DrawWallRevSubClamp(const WallDrawerArgs &args) override { Queue->Push<DrawWallRevSubClamp1PalCommand>(args); }

View file

@ -130,11 +130,11 @@ namespace swrenderer
// Textures that aren't masked can use the faster opaque drawer
if (!pic->GetTexture()->isMasked() && mask && alpha >= OPAQUE && !additive)
{
drawerargs.SetStyle(true, false, OPAQUE, mLight.GetBaseColormap());
drawerargs.SetStyle(true, false, OPAQUE, mLight.GetBaseColormap(), light_list);
}
else
{
drawerargs.SetStyle(mask, additive, alpha, mLight.GetBaseColormap());
drawerargs.SetStyle(mask, additive, alpha, mLight.GetBaseColormap(), light_list);
}
int count = x2 - x1;

View file

@ -35,11 +35,11 @@ namespace swrenderer
(thread->Drawers(dc_viewport)->*wallfunc)(*this);
}
void WallDrawerArgs::SetStyle(bool masked, bool additive, fixed_t alpha, FDynamicColormap *basecolormap)
void WallDrawerArgs::SetStyle(bool masked, bool additive, fixed_t alpha, FDynamicColormap *basecolormap, bool dynlights)
{
if (alpha < OPAQUE || additive)
{
if (!additive)
if (!additive && !dynlights)
{
wallfunc = &SWPixelFormatDrawers::DrawWallAdd;
dc_srcblend = Col2RGB8[alpha >> 10];
@ -47,6 +47,14 @@ namespace swrenderer
dc_srcalpha = alpha;
dc_destalpha = OPAQUE - alpha;
}
else if (!additive)
{
wallfunc = &SWPixelFormatDrawers::DrawWallAddClamp;
dc_srcblend = Col2RGB8_LessPrecision[alpha >> 10];
dc_destblend = Col2RGB8_LessPrecision[(OPAQUE - alpha) >> 10];
dc_srcalpha = alpha;
dc_destalpha = OPAQUE - alpha;
}
else
{
wallfunc = &SWPixelFormatDrawers::DrawWallAddClamp;

View file

@ -15,7 +15,7 @@ namespace swrenderer
class WallDrawerArgs : public DrawerArgs
{
public:
void SetStyle(bool masked, bool additive, fixed_t alpha, FDynamicColormap *basecolormap);
void SetStyle(bool masked, bool additive, fixed_t alpha, FDynamicColormap *basecolormap, bool dynlights);
void SetDest(RenderViewport *viewport);
void DrawWall(RenderThread *thread);