Skip to content

Commit e566f7b

Browse files
committed
glsl/normal: move SetHeightMapInNormalMap calls alongside other program selectors
1 parent 2bd5642 commit e566f7b

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

src/engine/renderer/tr_shade.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,8 @@ static void Render_vertexLighting_DBS_entity( int stage )
737737

738738
gl_vertexLightingShader_DBS_entity->SetParallaxMapping( parallaxMapping );
739739

740+
gl_vertexLightingShader_DBS_entity->SetHeightMapInNormalMap( heightMapInNormalMap );
741+
740742
gl_vertexLightingShader_DBS_entity->SetReflectiveSpecular( normalMapping && tr.cubeHashTable != nullptr );
741743

742744
gl_vertexLightingShader_DBS_entity->SetPhysicalShading( materialMapping );
@@ -815,8 +817,6 @@ static void Render_vertexLighting_DBS_entity( int stage )
815817
GL_BindToTMU( 1, tr.flatImage );
816818
}
817819

818-
gl_vertexLightingShader_DBS_entity->SetHeightMapInNormalMap( heightMapInNormalMap );
819-
820820
if ( specularMapping )
821821
{
822822
// bind u_SpecularMap
@@ -958,6 +958,8 @@ static void Render_vertexLighting_DBS_world( int stage )
958958

959959
gl_vertexLightingShader_DBS_world->SetParallaxMapping( parallaxMapping );
960960

961+
gl_vertexLightingShader_DBS_world->SetHeightMapInNormalMap( heightMapInNormalMap );
962+
961963
tess.vboVertexSprite = false;
962964

963965
gl_vertexLightingShader_DBS_world->BindProgram( pStage->deformIndex );
@@ -1060,8 +1062,6 @@ static void Render_vertexLighting_DBS_world( int stage )
10601062
GL_BindToTMU( 1, tr.flatImage );
10611063
}
10621064

1063-
gl_vertexLightingShader_DBS_world->SetHeightMapInNormalMap( heightMapInNormalMap );
1064-
10651065
if ( specularMapping )
10661066
{
10671067
// bind u_SpecularMap
@@ -1156,6 +1156,8 @@ static void Render_lightMapping( int stage, bool asColorMap, bool normalMapping,
11561156

11571157
gl_lightMappingShader->SetParallaxMapping( parallaxMapping );
11581158

1159+
gl_lightMappingShader->SetHeightMapInNormalMap( heightMapInNormalMap );
1160+
11591161
tess.vboVertexSprite = false;
11601162

11611163
gl_lightMappingShader->BindProgram( pStage->deformIndex );
@@ -1224,8 +1226,6 @@ static void Render_lightMapping( int stage, bool asColorMap, bool normalMapping,
12241226
GL_BindToTMU( 1, tr.flatImage );
12251227
}
12261228

1227-
gl_lightMappingShader->SetHeightMapInNormalMap( heightMapInNormalMap );
1228-
12291229
if ( specularMapping )
12301230
{
12311231
// bind u_SpecularMap
@@ -1449,6 +1449,8 @@ static void Render_forwardLighting_DBS_omni( shaderStage_t *diffuseStage,
14491449
gl_forwardLightingShader_omniXYZ->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
14501450

14511451
gl_forwardLightingShader_omniXYZ->SetParallaxMapping( parallaxMapping );
1452+
1453+
gl_forwardLightingShader_omniXYZ->SetHeightMapInNormalMap( heightMapInNormalMap );
14521454

14531455
gl_forwardLightingShader_omniXYZ->SetShadowing( shadowCompare );
14541456

@@ -1571,8 +1573,6 @@ static void Render_forwardLighting_DBS_omni( shaderStage_t *diffuseStage,
15711573
GL_BindToTMU( 1, tr.flatImage );
15721574
}
15731575

1574-
gl_forwardLightingShader_omniXYZ->SetHeightMapInNormalMap( heightMapInNormalMap );
1575-
15761576
if ( specularMapping )
15771577
{
15781578
// bind u_SpecularMap
@@ -1636,6 +1636,8 @@ static void Render_forwardLighting_DBS_proj( shaderStage_t *diffuseStage,
16361636
gl_forwardLightingShader_projXYZ->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
16371637

16381638
gl_forwardLightingShader_projXYZ->SetParallaxMapping( parallaxMapping );
1639+
1640+
gl_forwardLightingShader_projXYZ->SetHeightMapInNormalMap( heightMapInNormalMap );
16391641

16401642
gl_forwardLightingShader_projXYZ->SetShadowing( shadowCompare );
16411643

@@ -1759,8 +1761,6 @@ static void Render_forwardLighting_DBS_proj( shaderStage_t *diffuseStage,
17591761
GL_BindToTMU( 1, tr.flatImage );
17601762
}
17611763

1762-
gl_forwardLightingShader_projXYZ->SetHeightMapInNormalMap( heightMapInNormalMap );
1763-
17641764
if ( specularMapping )
17651765
{
17661766
// bind u_SpecularMap
@@ -1823,6 +1823,8 @@ static void Render_forwardLighting_DBS_directional( shaderStage_t *diffuseStage,
18231823

18241824
gl_forwardLightingShader_directionalSun->SetParallaxMapping( parallaxMapping );
18251825

1826+
gl_forwardLightingShader_directionalSun->SetHeightMapInNormalMap( heightMapInNormalMap );
1827+
18261828
gl_forwardLightingShader_directionalSun->SetShadowing( shadowCompare );
18271829

18281830
gl_forwardLightingShader_directionalSun->BindProgram( diffuseStage->deformIndex );
@@ -1949,8 +1951,6 @@ static void Render_forwardLighting_DBS_directional( shaderStage_t *diffuseStage,
19491951
GL_BindToTMU( 1, tr.flatImage );
19501952
}
19511953

1952-
gl_forwardLightingShader_directionalSun->SetHeightMapInNormalMap( heightMapInNormalMap );
1953-
19541954
if ( specularMapping )
19551955
{
19561956
// bind u_SpecularMap
@@ -2019,6 +2019,8 @@ static void Render_reflection_CB( int stage )
20192019
// choose right shader program ----------------------------------
20202020
gl_reflectionShader->SetParallaxMapping( parallaxMapping );
20212021

2022+
gl_reflectionShader->SetHeightMapInNormalMap( heightMapInNormalMap );
2023+
20222024
gl_reflectionShader->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
20232025
gl_reflectionShader->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
20242026

@@ -2081,8 +2083,6 @@ static void Render_reflection_CB( int stage )
20812083
// bind u_NormalFormat
20822084
gl_reflectionShader->SetUniform_NormalFormat( tess.surfaceShader->normalFormat );
20832085

2084-
gl_reflectionShader->SetHeightMapInNormalMap( heightMapInNormalMap );
2085-
20862086
gl_reflectionShader->SetRequiredVertexPointers();
20872087

20882088
Tess_DrawElements();

0 commit comments

Comments
 (0)