Skip to content

Commit

Permalink
renderer: do not load textures for disabled feature
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Aug 22, 2020
1 parent 0d1c72b commit 76cf787
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/engine/renderer/tr_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,17 @@ static bool LoadMap( shaderStage_t *stage, const char *buffer, const int bundleI

token = COM_ParseExt2( &buffer_p, false );

// NOTE: Normal map can ship height map in alpha channel.
if ( ( stage->type == stageType_t::ST_NORMALMAP && !r_normalMapping && !r_reliefMapping )
|| ( stage->type == stageType_t::ST_HEIGHTMAP && !r_reliefMapping )
|| ( stage->type == stageType_t::ST_SPECULARMAP && !r_specularMapping )
|| ( stage->type == stageType_t::ST_PHYSICALMAP && !r_physicalMapping )
|| ( stage->type == stageType_t::ST_GLOWMAP && !r_glowMapping )
|| ( stage->type == stageType_t::ST_REFLECTIONMAP && !r_reflectionMapping ) )
{
return true;
}

if ( !Q_stricmp( token, "$whiteimage" ) || !Q_stricmp( token, "$white" ) || !Q_stricmp( token, "_white" ) ||
!Q_stricmp( token, "*white" ) )
{
Expand Down

0 comments on commit 76cf787

Please sign in to comment.