Skip to content

Commit

Permalink
rgbgen
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jan 30, 2025
1 parent 6bcfb76 commit a5ef9fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/engine/renderer/tr_shade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2434,6 +2434,11 @@ void Tess_ComputeColor( shaderStage_t *pStage )
{
rgb = Math::Clamp( RB_EvalExpression( &pStage->rgbExp, 1.0 ), 0.0f, 1.0f );

if ( tr.worldLinearizeTexture )
{
rgb = convertFromSRGB ( rgb );
}

tess.svars.color = Color::White * rgb;
break;
}
Expand Down Expand Up @@ -2462,6 +2467,13 @@ void Tess_ComputeColor( shaderStage_t *pStage )
blue = Math::Clamp( RB_EvalExpression( &pStage->blueExp, 1.0 ), 0.0f, 1.0f );
}

if ( tr.worldLinearizeTexture )
{
red = convertFromSRGB ( red );
green = convertFromSRGB ( green );
blue = convertFromSRGB ( blue );
}

tess.svars.color.SetRed( red );
tess.svars.color.SetGreen( green );
tess.svars.color.SetBlue( blue );
Expand Down

0 comments on commit a5ef9fe

Please sign in to comment.