Skip to content

Commit 97c49b3

Browse files
committed
Fix CGEN_IDENTITY_LIGHTING with 2D drawing
Some 2D shaders are automatically assigned CGEN_IDENTITY_LIGHTING. This causes a bug of the cursor being black in the main menu (where tr.identityLighting is 0) and the wrong color if r_overbrightQ3 is used while in a map. Fix by making it behave as CGEN_IDENTITY during 2D rendering. Fixes #1590.
1 parent d39d77c commit 97c49b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/engine/renderer/tr_shade.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,14 @@ void Tess_ComputeColor( shaderStage_t *pStage )
23282328
switch ( pStage->rgbGen )
23292329
{
23302330
case colorGen_t::CGEN_IDENTITY_LIGHTING:
2331-
tess.svars.color = Color::Color(tr.identityLight, tr.identityLight, tr.identityLight);
2331+
if ( backEnd.projection2D )
2332+
{
2333+
tess.svars.color = Color::White;
2334+
}
2335+
else
2336+
{
2337+
tess.svars.color = Color::Color(tr.identityLight, tr.identityLight, tr.identityLight);
2338+
}
23322339
break;
23332340

23342341
case colorGen_t::CGEN_IDENTITY:

0 commit comments

Comments
 (0)