Skip to content

Commit 3d1ff0b

Browse files
committed
bikeshedding: rename heightMapInNormalMap as hasHeightMapInNormalMap
no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
1 parent 74353f1 commit 3d1ff0b

1 file changed

Lines changed: 31 additions & 31 deletions

File tree

src/engine/renderer/tr_shade.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@ static void Render_vertexLighting_DBS_entity( int stage )
737737
bool hasMaterialMap = pStage->bundle[ TB_MATERIALMAP ].image[ 0 ] != nullptr;
738738
bool hasGlowMap = pStage->bundle[ TB_GLOWMAP ].image[ 0 ] != nullptr;
739739

740-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
740+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
741741
bool isMaterialPhysical = pStage->collapseType == collapseType_t::COLLAPSE_lighting_PBR;
742742

743743
bool normalMapping = r_normalMapping->integer && hasNormalMap;
744-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
744+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
745745
bool physicalMapping = r_physicalMapping->integer && hasMaterialMap && isMaterialPhysical;
746746
bool specularMapping = r_specularMapping->integer && hasMaterialMap && !isMaterialPhysical;
747747
bool glowMapping = r_glowMapping->integer && hasGlowMap;
@@ -815,14 +815,14 @@ static void Render_vertexLighting_DBS_entity( int stage )
815815
depthScale *= parallaxDepthScale == 0 ? 1 : parallaxDepthScale;
816816
gl_vertexLightingShader_DBS_entity->SetUniform_ParallaxDepthScale( depthScale );
817817
gl_vertexLightingShader_DBS_entity->SetUniform_ParallaxOffsetBias( tess.surfaceShader->parallaxOffsetBias );
818-
gl_vertexLightingShader_DBS_entity->SetUniform_HeightMapInNormalMap( ( heightMapInNormalMap ) );
818+
gl_vertexLightingShader_DBS_entity->SetUniform_HeightMapInNormalMap( ( hasHeightMapInNormalMap ) );
819819
}
820820

821821
// bind u_DiffuseMap
822822
GL_BindToTMU( 0, pStage->bundle[ TB_DIFFUSEMAP ].image[ 0 ] );
823823
gl_vertexLightingShader_DBS_entity->SetUniform_TextureMatrix( tess.svars.texMatrices[ TB_DIFFUSEMAP ] );
824824

825-
if ( normalMapping || heightMapInNormalMap )
825+
if ( normalMapping || hasHeightMapInNormalMap )
826826
{
827827
// bind u_NormalMap
828828
GL_BindToTMU( 1, pStage->bundle[ TB_NORMALMAP ].image[ 0 ] );
@@ -975,11 +975,11 @@ static void Render_vertexLighting_DBS_world( int stage )
975975
bool hasMaterialMap = pStage->bundle[ TB_MATERIALMAP ].image[ 0 ] != nullptr;
976976
bool hasGlowMap = pStage->bundle[ TB_GLOWMAP ].image[ 0 ] != nullptr;
977977

978-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
978+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
979979
bool isMaterialPhysical = pStage->collapseType == collapseType_t::COLLAPSE_lighting_PBR;
980980

981981
bool normalMapping = r_normalMapping->integer && hasNormalMap;
982-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
982+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
983983
bool physicalMapping = r_physicalMapping->integer && hasMaterialMap && isMaterialPhysical;
984984
bool specularMapping = r_specularMapping->integer && hasMaterialMap && !isMaterialPhysical;
985985
bool glowMapping = r_glowMapping->integer && hasGlowMap;
@@ -1067,7 +1067,7 @@ static void Render_vertexLighting_DBS_world( int stage )
10671067
depthScale *= parallaxDepthScale == 0 ? 1 : parallaxDepthScale;
10681068
gl_vertexLightingShader_DBS_world->SetUniform_ParallaxDepthScale( depthScale );
10691069
gl_vertexLightingShader_DBS_world->SetUniform_ParallaxOffsetBias( tess.surfaceShader->parallaxOffsetBias );
1070-
gl_vertexLightingShader_DBS_world->SetUniform_HeightMapInNormalMap( ( heightMapInNormalMap ) );
1070+
gl_vertexLightingShader_DBS_world->SetUniform_HeightMapInNormalMap( ( hasHeightMapInNormalMap ) );
10711071
}
10721072

10731073
if( tr.world ) {
@@ -1079,7 +1079,7 @@ static void Render_vertexLighting_DBS_world( int stage )
10791079
GL_BindToTMU( 0, pStage->bundle[ TB_DIFFUSEMAP ].image[ 0 ] );
10801080
gl_vertexLightingShader_DBS_world->SetUniform_TextureMatrix( tess.svars.texMatrices[ TB_DIFFUSEMAP ] );
10811081

1082-
if ( normalMapping || heightMapInNormalMap )
1082+
if ( normalMapping || hasHeightMapInNormalMap )
10831083
{
10841084
// bind u_NormalMap
10851085
GL_BindToTMU( 1, pStage->bundle[ TB_NORMALMAP ].image[ 0 ] );
@@ -1181,11 +1181,11 @@ static void Render_lightMapping( int stage )
11811181
bool hasGlowMap = pStage->bundle[ TB_GLOWMAP ].image[ 0 ] != nullptr;
11821182

11831183
bool isMaterialPhysical = pStage->collapseType == collapseType_t::COLLAPSE_lighting_PBR;
1184-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
1184+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
11851185

11861186
bool normalMapping = r_normalMapping->integer && hasNormalMap;
11871187
bool deluxeMapping = r_deluxeMapping->integer && tr.worldDeluxeMapping && normalMapping;
1188-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
1188+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
11891189
bool physicalMapping = r_physicalMapping->integer && hasMaterialMap && isMaterialPhysical;
11901190
bool specularMapping = r_specularMapping->integer && hasMaterialMap && !isMaterialPhysical;
11911191
bool glowMapping = r_glowMapping->integer && hasGlowMap;
@@ -1245,7 +1245,7 @@ static void Render_lightMapping( int stage )
12451245
depthScale *= parallaxDepthScale == 0 ? 1 : parallaxDepthScale;
12461246
gl_lightMappingShader->SetUniform_ParallaxDepthScale( depthScale );
12471247
gl_lightMappingShader->SetUniform_ParallaxOffsetBias( tess.surfaceShader->parallaxOffsetBias );
1248-
gl_lightMappingShader->SetUniform_HeightMapInNormalMap( ( heightMapInNormalMap ) );
1248+
gl_lightMappingShader->SetUniform_HeightMapInNormalMap( ( hasHeightMapInNormalMap ) );
12491249
}
12501250

12511251
// bind u_DiffuseMap
@@ -1261,7 +1261,7 @@ static void Render_lightMapping( int stage )
12611261
}
12621262

12631263
// bind u_NormalMap
1264-
if ( normalMapping || heightMapInNormalMap )
1264+
if ( normalMapping || hasHeightMapInNormalMap )
12651265
{
12661266
GL_BindToTMU( 1, pStage->bundle[ TB_NORMALMAP ].image[ 0 ] );
12671267

@@ -1488,11 +1488,11 @@ static void Render_forwardLighting_DBS_omni( shaderStage_t *pStage,
14881488
bool hasMaterialMap = pStage->bundle[ TB_MATERIALMAP ].image[ 0 ] != nullptr;
14891489
bool hasGlowMap = pStage->bundle[ TB_GLOWMAP ].image[ 0 ] != nullptr;
14901490

1491-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
1491+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
14921492
bool isMaterialPhysical = pStage->collapseType == collapseType_t::COLLAPSE_lighting_PBR;
14931493

14941494
bool normalMapping = r_normalMapping->integer && hasNormalMap;
1495-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
1495+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
14961496
// physical mapping is not implemented
14971497
bool specularMapping = r_specularMapping->integer && hasMaterialMap && !isMaterialPhysical;
14981498

@@ -1554,7 +1554,7 @@ static void Render_forwardLighting_DBS_omni( shaderStage_t *pStage,
15541554
depthScale *= parallaxDepthScale == 0 ? 1 : parallaxDepthScale;
15551555
gl_forwardLightingShader_omniXYZ->SetUniform_ParallaxDepthScale( depthScale );
15561556
gl_forwardLightingShader_omniXYZ->SetUniform_ParallaxOffsetBias( tess.surfaceShader->parallaxOffsetBias );
1557-
gl_forwardLightingShader_omniXYZ->SetUniform_HeightMapInNormalMap( heightMapInNormalMap );
1557+
gl_forwardLightingShader_omniXYZ->SetUniform_HeightMapInNormalMap( hasHeightMapInNormalMap );
15581558
}
15591559

15601560
// set uniforms
@@ -1613,7 +1613,7 @@ static void Render_forwardLighting_DBS_omni( shaderStage_t *pStage,
16131613
GL_BindToTMU( 0, pStage->bundle[ TB_DIFFUSEMAP ].image[ 0 ] );
16141614
gl_forwardLightingShader_omniXYZ->SetUniform_TextureMatrix( tess.svars.texMatrices[ TB_DIFFUSEMAP ] );
16151615

1616-
if ( normalMapping || heightMapInNormalMap )
1616+
if ( normalMapping || hasHeightMapInNormalMap )
16171617
{
16181618
// bind u_NormalMap
16191619
GL_BindToTMU( 1, pStage->bundle[ TB_NORMALMAP ].image[ 0 ] );
@@ -1685,11 +1685,11 @@ static void Render_forwardLighting_DBS_proj( shaderStage_t *pStage,
16851685
bool hasNormalMap = pStage->bundle[ TB_NORMALMAP ].image[ 0 ] != nullptr;
16861686
bool hasMaterialMap = pStage->bundle[ TB_MATERIALMAP ].image[ 0 ] != nullptr;
16871687

1688-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
1688+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
16891689
bool isMaterialPhysical = pStage->collapseType == collapseType_t::COLLAPSE_lighting_PBR;
16901690

16911691
bool normalMapping = r_normalMapping->integer && hasNormalMap;
1692-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
1692+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
16931693
// physical mapping is not implemented
16941694
bool specularMapping = r_specularMapping->integer && hasMaterialMap && !isMaterialPhysical;
16951695

@@ -1751,7 +1751,7 @@ static void Render_forwardLighting_DBS_proj( shaderStage_t *pStage,
17511751
depthScale *= parallaxDepthScale == 0 ? 1 : parallaxDepthScale;
17521752
gl_forwardLightingShader_projXYZ->SetUniform_ParallaxDepthScale( depthScale );
17531753
gl_forwardLightingShader_projXYZ->SetUniform_ParallaxOffsetBias( tess.surfaceShader->parallaxOffsetBias );
1754-
gl_forwardLightingShader_projXYZ->SetUniform_HeightMapInNormalMap( heightMapInNormalMap );
1754+
gl_forwardLightingShader_projXYZ->SetUniform_HeightMapInNormalMap( hasHeightMapInNormalMap );
17551755
}
17561756

17571757
// set uniforms
@@ -1811,7 +1811,7 @@ static void Render_forwardLighting_DBS_proj( shaderStage_t *pStage,
18111811
GL_BindToTMU( 0, pStage->bundle[ TB_DIFFUSEMAP ].image[ 0 ] );
18121812
gl_forwardLightingShader_projXYZ->SetUniform_TextureMatrix( tess.svars.texMatrices[ TB_DIFFUSEMAP ] );
18131813

1814-
if ( normalMapping || heightMapInNormalMap )
1814+
if ( normalMapping || hasHeightMapInNormalMap )
18151815
{
18161816
// bind u_NormalMap
18171817
GL_BindToTMU( 1, pStage->bundle[ TB_NORMALMAP ].image[ 0 ] );
@@ -1881,11 +1881,11 @@ static void Render_forwardLighting_DBS_directional( shaderStage_t *pStage, trRef
18811881
bool hasNormalMap = pStage->bundle[ TB_NORMALMAP ].image[ 0 ] != nullptr;
18821882
bool hasMaterialMap = pStage->bundle[ TB_MATERIALMAP ].image[ 0 ] != nullptr;
18831883

1884-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
1884+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
18851885
bool isMaterialPhysical = pStage->collapseType == collapseType_t::COLLAPSE_lighting_PBR;
18861886

18871887
bool normalMapping = r_normalMapping->integer && hasNormalMap;
1888-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
1888+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
18891889
// physical mapping is not implemented
18901890
bool specularMapping = r_specularMapping->integer && hasMaterialMap && !isMaterialPhysical;
18911891

@@ -1947,7 +1947,7 @@ static void Render_forwardLighting_DBS_directional( shaderStage_t *pStage, trRef
19471947
depthScale *= parallaxDepthScale == 0 ? 1 : parallaxDepthScale;
19481948
gl_forwardLightingShader_directionalSun->SetUniform_ParallaxDepthScale( depthScale );
19491949
gl_forwardLightingShader_directionalSun->SetUniform_ParallaxOffsetBias( tess.surfaceShader->parallaxOffsetBias );
1950-
gl_forwardLightingShader_directionalSun->SetUniform_HeightMapInNormalMap( heightMapInNormalMap );
1950+
gl_forwardLightingShader_directionalSun->SetUniform_HeightMapInNormalMap( hasHeightMapInNormalMap );
19511951
}
19521952

19531953
// set uniforms
@@ -2011,7 +2011,7 @@ static void Render_forwardLighting_DBS_directional( shaderStage_t *pStage, trRef
20112011
GL_BindToTMU( 0, pStage->bundle[ TB_DIFFUSEMAP ].image[ 0 ] );
20122012
gl_forwardLightingShader_directionalSun->SetUniform_TextureMatrix( tess.svars.texMatrices[ TB_DIFFUSEMAP ] );
20132013

2014-
if ( normalMapping || heightMapInNormalMap )
2014+
if ( normalMapping || hasHeightMapInNormalMap )
20152015
{
20162016
// bind u_NormalMap
20172017
GL_BindToTMU( 1, pStage->bundle[ TB_NORMALMAP ].image[ 0 ] );
@@ -2090,10 +2090,10 @@ static void Render_reflection_CB( int stage )
20902090

20912091
bool hasNormalMap = pStage->bundle[ TB_NORMALMAP ].image[ 0 ] != nullptr;
20922092

2093-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
2093+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
20942094

20952095
bool normalMapping = r_normalMapping->integer && hasNormalMap;
2096-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
2096+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
20972097

20982098
// choose right shader program ----------------------------------
20992099
gl_reflectionShader->SetParallaxMapping( parallaxMapping );
@@ -2133,7 +2133,7 @@ static void Render_reflection_CB( int stage )
21332133
GL_BindNearestCubeMap( backEnd.viewParms.orientation.origin );
21342134
}
21352135

2136-
if ( normalMapping || heightMapInNormalMap )
2136+
if ( normalMapping || hasHeightMapInNormalMap )
21372137
{
21382138
// bind u_NormalMap
21392139
GL_BindToTMU( 1, pStage->bundle[ TB_NORMALMAP ].image[ 0 ] );
@@ -2155,7 +2155,7 @@ static void Render_reflection_CB( int stage )
21552155
depthScale *= parallaxDepthScale == 0 ? 1 : parallaxDepthScale;
21562156
gl_reflectionShader->SetUniform_ParallaxDepthScale( depthScale );
21572157
gl_reflectionShader->SetUniform_ParallaxOffsetBias( tess.surfaceShader->parallaxOffsetBias );
2158-
gl_reflectionShader->SetUniform_HeightMapInNormalMap( ( heightMapInNormalMap ) );
2158+
gl_reflectionShader->SetUniform_HeightMapInNormalMap( ( hasHeightMapInNormalMap ) );
21592159
}
21602160

21612161
vec3_t normalScale = { 1, 1, 1 };
@@ -2362,10 +2362,10 @@ static void Render_liquid( int stage )
23622362

23632363
bool hasNormalMap = pStage->bundle[ TB_COLORMAP ].image[ 0 ] != nullptr;
23642364

2365-
bool heightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
2365+
bool hasHeightMapInNormalMap = pStage->heightMapInNormalMap && hasNormalMap;
23662366

23672367
bool normalMapping = r_normalMapping->integer && hasNormalMap;
2368-
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && heightMapInNormalMap;
2368+
bool parallaxMapping = r_parallaxMapping->integer && !tess.surfaceShader->noParallax && hasHeightMapInNormalMap;
23692369
// specular component is computed by shader
23702370
// physical mapping is not implemented
23712371
bool specularMapping = r_specularMapping->integer;
@@ -2416,7 +2416,7 @@ static void Render_liquid( int stage )
24162416
// depth texture
24172417
GL_BindToTMU( 2, tr.currentDepthImage );
24182418

2419-
if ( normalMapping || heightMapInNormalMap )
2419+
if ( normalMapping || hasHeightMapInNormalMap )
24202420
{
24212421
// bind u_NormalMap
24222422
GL_BindToTMU( 3, pStage->bundle[ TB_COLORMAP ].image[ 0 ] );

0 commit comments

Comments
 (0)