diff --git a/Generals/Code/GameEngine/Include/Common/GameLOD.h b/Generals/Code/GameEngine/Include/Common/GameLOD.h index 7ed420b22b..61d13e3d7e 100644 --- a/Generals/Code/GameEngine/Include/Common/GameLOD.h +++ b/Generals/Code/GameEngine/Include/Common/GameLOD.h @@ -203,6 +203,7 @@ class GameLODManager void applyStaticLODLevel(StaticGameLODLevel level); void applyDynamicLODLevel(DynamicGameLODLevel level); void refreshCustomStaticLODLevel(void); ///m_textureReduction; + { + requestedTextureReduction = lodInfo->m_textureReduction; requestedTrees = lodInfo->m_useTrees; } else - if (level >= STATIC_GAME_LOD_LOW) - { //normal non-custom level gets texture reduction based on recommendation - requestedTextureReduction = getRecommendedTextureReduction(); + { + //normal non-custom level gets texture reduction based on recommendation + StaticGameLODLevel textureLevel = getRecommendedTextureLODLevel(); + if (textureLevel == STATIC_GAME_LOD_UNKNOWN) + textureLevel = level; + requestedTextureReduction = getLevelTextureReduction(textureLevel); + + //only use trees if memory requirement passed. + requestedTrees = m_memPassed; } if (TheGlobalData) @@ -717,16 +724,36 @@ void GameLODManager::applyDynamicLODLevel(DynamicGameLODLevel level) Int GameLODManager::getRecommendedTextureReduction(void) { - if (m_idealDetailLevel == STATIC_GAME_LOD_UNKNOWN) - getRecommendedStaticLODLevel(); //it was never tested, so test now. + StaticGameLODLevel level = getRecommendedTextureLODLevel(); + + if (level == STATIC_GAME_LOD_UNKNOWN) + { + level = getStaticLODLevel(); + } + return getLevelTextureReduction(level); +} - if (!m_memPassed) //if they have < 256 MB, force them to low res textures. - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); +StaticGameLODLevel GameLODManager::getRecommendedTextureLODLevel() +{ + // TheSuperHackers @bugfix xezon 24/09/2025 Disables the recommended static LOD level for texture reduction + // because the benchmark code always generates a low level for it. Can revisit if the benchmarking is changed. + constexpr const Bool UseRecommendedStaticLODLevel = FALSE; - if (m_idealDetailLevel < 0 || m_idealDetailLevel >= STATIC_GAME_LOD_COUNT) - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); + StaticGameLODLevel level = STATIC_GAME_LOD_LOW; - return getLevelTextureReduction(m_idealDetailLevel); + // Force low res textures if user has less than 256 MB. + if (m_memPassed) + { + if constexpr (UseRecommendedStaticLODLevel) + { + level = getRecommendedStaticLODLevel(); + } + else + { + level = STATIC_GAME_LOD_UNKNOWN; + } + } + return level; } Int GameLODManager::getLevelTextureReduction(StaticGameLODLevel level) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h index e4d90fd4d4..e9ddaa78dd 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h @@ -204,6 +204,7 @@ class GameLODManager void applyStaticLODLevel(StaticGameLODLevel level); void applyDynamicLODLevel(DynamicGameLODLevel level); void refreshCustomStaticLODLevel(void); ///m_textureReduction; + { + requestedTextureReduction = lodInfo->m_textureReduction; requestedTrees = lodInfo->m_useTrees; } else - if (level >= STATIC_GAME_LOD_LOW) - { //normal non-custom level gets texture reduction based on recommendation - requestedTextureReduction = getRecommendedTextureReduction(); + { + //normal non-custom level gets texture reduction based on recommendation + StaticGameLODLevel textureLevel = getRecommendedTextureLODLevel(); + if (textureLevel == STATIC_GAME_LOD_UNKNOWN) + textureLevel = level; + requestedTextureReduction = getLevelTextureReduction(textureLevel); + + //only use trees if memory requirement passed. + requestedTrees = m_memPassed; } if (TheGlobalData) @@ -723,16 +730,36 @@ void GameLODManager::applyDynamicLODLevel(DynamicGameLODLevel level) Int GameLODManager::getRecommendedTextureReduction(void) { - if (m_idealDetailLevel == STATIC_GAME_LOD_UNKNOWN) - getRecommendedStaticLODLevel(); //it was never tested, so test now. + StaticGameLODLevel level = getRecommendedTextureLODLevel(); + + if (level == STATIC_GAME_LOD_UNKNOWN) + { + level = getStaticLODLevel(); + } + return getLevelTextureReduction(level); +} - if (!m_memPassed) //if they have < 256 MB, force them to low res textures. - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); +StaticGameLODLevel GameLODManager::getRecommendedTextureLODLevel() +{ + // TheSuperHackers @bugfix xezon 24/09/2025 Disables the recommended static LOD level for texture reduction + // because the benchmark code always generates a low level for it. Can revisit if the benchmarking is changed. + constexpr const Bool UseRecommendedStaticLODLevel = FALSE; - if (m_idealDetailLevel < 0 || m_idealDetailLevel >= STATIC_GAME_LOD_COUNT) - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); + StaticGameLODLevel level = STATIC_GAME_LOD_LOW; - return getLevelTextureReduction(m_idealDetailLevel); + // Force low res textures if user has less than 256 MB. + if (m_memPassed) + { + if constexpr (UseRecommendedStaticLODLevel) + { + level = getRecommendedStaticLODLevel(); + } + else + { + level = STATIC_GAME_LOD_UNKNOWN; + } + } + return level; } Int GameLODManager::getLevelTextureReduction(StaticGameLODLevel level)