diff --git a/src/engine/renderer/tr_local.h b/src/engine/renderer/tr_local.h index a26bae507d..ee74bdc45f 100644 --- a/src/engine/renderer/tr_local.h +++ b/src/engine/renderer/tr_local.h @@ -3455,6 +3455,7 @@ inline bool checkGLErrors() void Render_NONE( shaderStage_t *pStage ); void Render_NOP( shaderStage_t *pStage ); void Render_generic( shaderStage_t *pStage ); + void Render_generic2D( shaderStage_t *pStage ); void Render_generic3D( shaderStage_t *pStage ); void Render_lightMapping( shaderStage_t *pStage ); void Render_reflection_CB( shaderStage_t *pStage ); diff --git a/src/engine/renderer/tr_shade.cpp b/src/engine/renderer/tr_shade.cpp index 595bb38e1f..74926dcce9 100644 --- a/src/engine/renderer/tr_shade.cpp +++ b/src/engine/renderer/tr_shade.cpp @@ -621,7 +621,7 @@ void Render_NOP( shaderStage_t * ) { } -static void Render_generic2D( shaderStage_t *pStage ) +void Render_generic2D( shaderStage_t *pStage ) { GLimp_LogComment( "--- Render_generic2D ---\n" ); diff --git a/src/engine/renderer/tr_shader.cpp b/src/engine/renderer/tr_shader.cpp index 7c9a3856b2..dee225e1cd 100644 --- a/src/engine/renderer/tr_shader.cpp +++ b/src/engine/renderer/tr_shader.cpp @@ -5382,12 +5382,15 @@ static void SetStagesRenderers() stageRendererOptions_t stageRendererOptions = { &Render_NONE, false, false }; - bool opaqueOrLess = shader.sort <= Util::ordinal(shaderSort_t::SS_OPAQUE); - switch ( stage->type ) { case stageType_t::ST_COLORMAP: - stageRendererOptions = { &Render_generic, opaqueOrLess, false }; + { + bool opaqueOrLess = shader.sort <= Util::ordinal(shaderSort_t::SS_OPAQUE); + bool is2D = stage->bundle[ TB_COLORMAP ].image[ 0 ]->bits & RSF_2D; + stageRenderer_t genericRenderer = is2D ? Render_generic2D : Render_generic; + stageRendererOptions = { genericRenderer, opaqueOrLess, false }; + } break; case stageType_t::ST_STYLELIGHTMAP: case stageType_t::ST_STYLECOLORMAP: