Skip to content

Commit

Permalink
temp: remove some SetUniform_InverseLightFactor() calls in advance
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Nov 12, 2024
1 parent 774b0f8 commit b5fb9c9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
4 changes: 0 additions & 4 deletions src/engine/renderer/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,6 @@ void UpdateSurfaceDataGeneric3D( uint32_t* materials, Material& material, drawSu
// u_AlphaThreshold
gl_generic3DShaderMaterial->SetUniform_AlphaTest( pStage->stateBits );

// u_InverseLightFactor
float inverseLightFactor = pStage->cancelOverBright ? tr.mapInverseLightFactor : 1.0f;
gl_genericShaderMaterial->SetUniform_InverseLightFactor( inverseLightFactor );

// u_ColorModulate
colorGen_t rgbGen = SetRgbGen( pStage );
alphaGen_t alphaGen = SetAlphaGen( pStage );
Expand Down
12 changes: 0 additions & 12 deletions src/engine/renderer/tr_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,6 @@ static void RB_SetupLightForLighting( trRefLight_t *light )
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_Color( Color::Black );
// TODO: set u_InverseLightFactor!

GL_State( GLS_POLYMODE_LINE | GLS_DEPTHTEST_DISABLE );
GL_Cull( cullType_t::CT_TWO_SIDED );
Expand Down Expand Up @@ -2762,7 +2761,6 @@ void RB_RunVisTests( )
gl_genericShader->SetUniform_Color( Color::White );

gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_CONST, alphaGen_t::AGEN_CONST );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );
gl_genericShader->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_genericShader->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[ glState.stackIndex ] );

Expand Down Expand Up @@ -3392,7 +3390,6 @@ static void RB_RenderDebugUtils()

// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_CUSTOM_RGB, alphaGen_t::AGEN_CUSTOM );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

// bind u_ColorMap
gl_genericShader->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -3529,7 +3526,6 @@ static void RB_RenderDebugUtils()
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_Color( Color::Black );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

// bind u_ColorMap
gl_genericShader->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -3639,7 +3635,6 @@ static void RB_RenderDebugUtils()
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_Color( Color::Black );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

// bind u_ColorMap
gl_genericShader->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -3699,7 +3694,6 @@ static void RB_RenderDebugUtils()
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_Color( Color::Black );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

// bind u_ColorMap
gl_genericShader->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -3907,7 +3901,6 @@ static void RB_RenderDebugUtils()

// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_CUSTOM_RGB, alphaGen_t::AGEN_CUSTOM );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

// bind u_ColorMap
gl_genericShader->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -4038,7 +4031,6 @@ static void RB_RenderDebugUtils()
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_Color( Color::Black );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

GL_State( GLS_DEFAULT );
GL_Cull( cullType_t::CT_TWO_SIDED );
Expand Down Expand Up @@ -4115,7 +4107,6 @@ static void RB_RenderDebugUtils()
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_Color( Color::Black );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

GL_State( GLS_DEFAULT );
GL_Cull( cullType_t::CT_TWO_SIDED );
Expand Down Expand Up @@ -4200,7 +4191,6 @@ static void RB_RenderDebugUtils()

// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_CUSTOM_RGB, alphaGen_t::AGEN_CUSTOM );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

// bind u_ColorMap
gl_genericShader->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -4494,7 +4484,6 @@ void DebugDrawBegin( debugDrawMode_t mode, float size ) {
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_Color( colorClear );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

// bind u_ColorMap
gl_genericShader->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -5609,7 +5598,6 @@ void RB_ShowImages()
// set uniforms
gl_genericShader->SetUniform_ColorModulate( colorGen_t::CGEN_VERTEX, alphaGen_t::AGEN_VERTEX );
gl_genericShader->SetUniform_TextureMatrix( matrixIdentity );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );

GL_SelectTexture( 0 );

Expand Down
5 changes: 0 additions & 5 deletions src/engine/renderer/tr_shade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ static void DrawTris()
}

gl_generic3DShader->SetUniform_ColorModulate( colorGen_t::CGEN_CONST, alphaGen_t::AGEN_CONST );
gl_genericShader->SetUniform_InverseLightFactor( tr.mapInverseLightFactor );
gl_generic3DShader->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_generic3DShader->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[ glState.stackIndex ] );

Expand Down Expand Up @@ -923,10 +922,6 @@ void Render_generic3D( shaderStage_t *pStage )
// u_AlphaThreshold
gl_generic3DShader->SetUniform_AlphaTest( pStage->stateBits );

// u_InverseLightFactor
float inverseLightFactor = pStage->cancelOverBright ? tr.mapInverseLightFactor : 1.0f;
gl_genericShader->SetUniform_InverseLightFactor( inverseLightFactor );

// u_ColorModulate
colorGen_t rgbGen = SetRgbGen( pStage );
alphaGen_t alphaGen = SetAlphaGen( pStage );
Expand Down

0 comments on commit b5fb9c9

Please sign in to comment.