Skip to content

Commit 7728dc3

Browse files
Fullscreen effects always need to be in sRGB. close #292
1 parent 1275984 commit 7728dc3

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

neo/renderer/tr_backend_draw.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,7 +3831,15 @@ static int RB_DrawShaderPasses( const drawSurf_t* const* const drawSurfs, const
38313831
}
38323832
else
38333833
{
3834-
renderProgManager.BindShader_TextureVertexColor();
3834+
if( backEnd.viewDef->is2Dgui )
3835+
{
3836+
// RB: 2D fullscreen drawing like warp or damage blend effects
3837+
renderProgManager.BindShader_TextureVertexColor_sRGB();
3838+
}
3839+
else
3840+
{
3841+
renderProgManager.BindShader_TextureVertexColor();
3842+
}
38353843
}
38363844
}
38373845
}
@@ -5227,11 +5235,13 @@ void RB_DrawViewInternal( const viewDef_t* viewDef, const int stereoEye )
52275235

52285236
//GL_CheckErrors();
52295237

5238+
// RB begin
5239+
bool useHDR = r_useHDR.GetBool() && !viewDef->is2Dgui;
5240+
52305241
// Clear the depth buffer and clear the stencil to 128 for stencil shadows as well as gui masking
5231-
GL_Clear( false, true, true, STENCIL_SHADOW_TEST_VALUE, 0.0f, 0.0f, 0.0f, 0.0f, true );
5242+
GL_Clear( false, true, true, STENCIL_SHADOW_TEST_VALUE, 0.0f, 0.0f, 0.0f, 0.0f, useHDR );
52325243

5233-
// RB begin
5234-
if( r_useHDR.GetBool() && !viewDef->is2Dgui )
5244+
if( useHDR )
52355245
{
52365246
globalFramebuffers.hdrFBO->Bind();
52375247
}
@@ -5402,7 +5412,7 @@ void RB_DrawViewInternal( const viewDef_t* viewDef, const int stereoEye )
54025412
RB_RenderDebugTools( drawSurfs, numDrawSurfs );
54035413

54045414
// RB: convert back from HDR to LDR range
5405-
if( r_useHDR.GetBool() && !viewDef->is2Dgui )
5415+
if( useHDR )
54065416
{
54075417
/*
54085418
int x = backEnd.viewDef->viewport.x1;

0 commit comments

Comments
 (0)