Skip to content

Commit

Permalink
Fullscreen effects always need to be in sRGB. close #292
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBeckebans committed Feb 2, 2016
1 parent 1275984 commit 7728dc3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions neo/renderer/tr_backend_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3831,7 +3831,15 @@ static int RB_DrawShaderPasses( const drawSurf_t* const* const drawSurfs, const
}
else
{
renderProgManager.BindShader_TextureVertexColor();
if( backEnd.viewDef->is2Dgui )
{
// RB: 2D fullscreen drawing like warp or damage blend effects
renderProgManager.BindShader_TextureVertexColor_sRGB();
}
else
{
renderProgManager.BindShader_TextureVertexColor();
}
}
}
}
Expand Down Expand Up @@ -5227,11 +5235,13 @@ void RB_DrawViewInternal( const viewDef_t* viewDef, const int stereoEye )

//GL_CheckErrors();

// RB begin
bool useHDR = r_useHDR.GetBool() && !viewDef->is2Dgui;

// Clear the depth buffer and clear the stencil to 128 for stencil shadows as well as gui masking
GL_Clear( false, true, true, STENCIL_SHADOW_TEST_VALUE, 0.0f, 0.0f, 0.0f, 0.0f, true );
GL_Clear( false, true, true, STENCIL_SHADOW_TEST_VALUE, 0.0f, 0.0f, 0.0f, 0.0f, useHDR );

// RB begin
if( r_useHDR.GetBool() && !viewDef->is2Dgui )
if( useHDR )
{
globalFramebuffers.hdrFBO->Bind();
}
Expand Down Expand Up @@ -5402,7 +5412,7 @@ void RB_DrawViewInternal( const viewDef_t* viewDef, const int stereoEye )
RB_RenderDebugTools( drawSurfs, numDrawSurfs );

// RB: convert back from HDR to LDR range
if( r_useHDR.GetBool() && !viewDef->is2Dgui )
if( useHDR )
{
/*
int x = backEnd.viewDef->viewport.x1;
Expand Down

0 comments on commit 7728dc3

Please sign in to comment.