Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/engine/renderer/tr_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3277,6 +3277,13 @@ static bool ParseStage( shaderStage_t *stage, const char **text )
// compute state bits
stage->stateBits = colorMaskBits | depthMaskBits | blendSrcBits | blendDstBits | atestBits | depthFuncBits | polyModeBits;

// Do not load heatHaze maps when r_heatHaze is disabled.
if ( stage->type == stageType_t::ST_HEATHAZEMAP && !r_heatHaze->integer )
{
stage->active = false;
return true;
}

// load image
if ( loadMap && !LoadMap( stage, buffer, stage->type ) )
{
Expand Down Expand Up @@ -3866,8 +3873,6 @@ static bool ParseShader( const char *_text )
return false;
}

stage->active = true;

/* Examples of shaders with light styles, those
shaders are generated by the q3map2 map compiler.

Expand Down Expand Up @@ -5181,7 +5186,6 @@ static void FinishStages()
switch ( stage->type )
{
case stageType_t::ST_HEATHAZEMAP:
stage->active = r_heatHaze->integer;
stage->stateBits &= ~( GLS_ATEST_BITS | GLS_DEPTHMASK_TRUE );
break;

Expand Down