Skip to content
Permalink
Browse files

tr_shade: factorize normal map presence test

  • Loading branch information...
illwieckz committed Mar 31, 2019
1 parent 8aa22f4 commit 8efc53510f526a97c29799c2886e619be045c47a
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/engine/renderer/tr_shade.cpp
@@ -1154,9 +1154,11 @@ static void Render_lightMapping( int stage, bool asColorMap, bool normalMapping,

GL_State( stateBits );

bool deluxeMapping = r_deluxeMapping->integer && tr.worldDeluxeMapping && ( pStage->bundle[ TB_NORMALMAP ].image[ 0 ] != nullptr );
normalMapping = normalMapping && deluxeMapping;
bool heightMapInNormalMap = tess.surfaceShader->heightMapInNormalMap && ( pStage->bundle[ TB_NORMALMAP ].image[ 0 ] != nullptr );
bool hasNormalMap = pStage->bundle[ TB_NORMALMAP ].image[ 0 ] != nullptr;

bool deluxeMapping = r_deluxeMapping->integer && tr.worldDeluxeMapping && hasNormalMap;
normalMapping &= deluxeMapping; // && hasNormalMap (done for deluxeMapping)
bool heightMapInNormalMap = tess.surfaceShader->heightMapInNormalMap && hasNormalMap;
bool parallaxMapping = r_parallaxMapping->integer && tess.surfaceShader->parallax && !tess.surfaceShader->noParallax && heightMapInNormalMap;
bool specularMapping = r_specularMapping->integer && ( pStage->bundle[ TB_SPECULARMAP ].image[ 0 ] );
bool glowMapping = r_glowMapping->integer && ( pStage->bundle[ TB_GLOWMAP ].image[ 0 ] != nullptr );

0 comments on commit 8efc535

Please sign in to comment.
You can’t perform that action at this time.