Skip to content

Commit e0facd7

Browse files
committed
Use grid deluxe for world with r_lightMode 2
Increased macro permutations isn't much of a concern any more since we don't build unused ones by default.
1 parent 3763d81 commit e0facd7

3 files changed

Lines changed: 6 additions & 17 deletions

File tree

src/engine/renderer/gl_shader.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ bool GLCompileMacro_USE_GRID_DELUXE_MAPPING::HasConflictingMacros(size_t permuta
21122112
{
21132113
for (const GLCompileMacro* macro : macros)
21142114
{
2115-
if ((permutation & macro->GetBit()) != 0 && (macro->GetType() == USE_DELUXE_MAPPING || macro->GetType() == USE_BSP_SURFACE))
2115+
if ((permutation & macro->GetBit()) != 0 && (macro->GetType() == USE_DELUXE_MAPPING))
21162116
{
21172117
return true;
21182118
}
@@ -2140,19 +2140,6 @@ bool GLCompileMacro_USE_GRID_LIGHTING::HasConflictingMacros(size_t permutation,
21402140
return false;
21412141
}
21422142

2143-
bool GLCompileMacro_USE_BSP_SURFACE::HasConflictingMacros(size_t permutation, const std::vector<GLCompileMacro*> &macros) const
2144-
{
2145-
for (const GLCompileMacro* macro : macros)
2146-
{
2147-
if ((permutation & macro->GetBit()) != 0 && (macro->GetType() == USE_GRID_DELUXE_MAPPING))
2148-
{
2149-
return true;
2150-
}
2151-
}
2152-
2153-
return false;
2154-
}
2155-
21562143
void GLShader::RegisterUniform( GLUniform* uniform ) {
21572144
_uniforms.push_back( uniform );
21582145
}

src/engine/renderer/gl_shader.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,6 @@ class GLCompileMacro_USE_BSP_SURFACE :
10291029
return "USE_BSP_SURFACE";
10301030
}
10311031

1032-
bool HasConflictingMacros(size_t permutation, const std::vector< GLCompileMacro * > &macros) const override;
1033-
10341032
EGLCompileMacro GetType() const override
10351033
{
10361034
return EGLCompileMacro::USE_BSP_SURFACE;

src/engine/renderer/tr_bsp.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4657,7 +4657,11 @@ static void SetWorldLight() {
46574657
// Game model surfaces use grid lighting, they don't have vertex light colors.
46584658
tr.modelDeluxe = deluxeMode_t::GRID;
46594659

4660-
// Only game models use emulated deluxe map from light direction grid.
4660+
// Only game models use emulated deluxe map from light direction grid, unless the
4661+
// `r_lightMode 2` debug option is used.
4662+
if ( tr.worldLight == lightMode_t::GRID ) {
4663+
tr.worldDeluxe = deluxeMode_t::GRID;
4664+
}
46614665
}
46624666
}
46634667

0 commit comments

Comments
 (0)