Skip to content

Commit

Permalink
[rend2] Fix korriban shaders with multiply blend stages
Browse files Browse the repository at this point in the history
Stages that are used to get some more detail shouldnt be collapsed with lighting because it will multiply lighting again and again which leads to incorrect darkening
  • Loading branch information
SomaZ committed May 13, 2024
1 parent 1ac5652 commit 6029f91
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions shared/rd-rend2/tr_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3372,6 +3372,14 @@ static qboolean CollapseStagesToGLSL(void)
if (pStage->bundle[0].tcGen >= TCGEN_LIGHTMAP && pStage->bundle[0].tcGen <= TCGEN_LIGHTMAP3)
continue;

if (i > 0)
{
int blendBits = pStage->stateBits & (GLS_DSTBLEND_BITS | GLS_SRCBLEND_BITS);
if (blendBits == (GLS_DSTBLEND_SRC_COLOR | GLS_SRCBLEND_ZERO) ||
blendBits == (GLS_DSTBLEND_ZERO | GLS_SRCBLEND_DST_COLOR))
continue;
}

diffuse = pStage;
parallax = qfalse;
lightmap = NULL;
Expand Down

0 comments on commit 6029f91

Please sign in to comment.