Skip to content

Commit

Permalink
renderer/tr_shader: disable useless heightMapInNormalMap if both norm…
Browse files Browse the repository at this point in the history
…al and relief mapping are disabled, also fix #376
  • Loading branch information
illwieckz committed Oct 12, 2020
1 parent 5bd030d commit e40828d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/engine/renderer/tr_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4819,6 +4819,10 @@ static void CollapseStages()
stage->enableSpecularMapping = r_specularMapping->integer && stage->hasMaterialMap && !stage->isMaterialPhysical;
stage->enableGlowMapping = r_glowMapping->integer && stage->hasGlowMap;

// Finally disable useless heightMapInNormalMap if both normal and relief mapping are disabled.
// see https://github.com/DaemonEngine/Daemon/issues/376
stage->isHeightMapInNormalMap = stage->isHeightMapInNormalMap && ( stage->enableNormalMapping || stage->enableReliefMapping );

// Bind fallback textures if required.
if ( !stage->enableNormalMapping && !( stage->enableReliefMapping && stage->isHeightMapInNormalMap) )
{
Expand Down

0 comments on commit e40828d

Please sign in to comment.