Skip to content

Commit

Permalink
🐛 Fixed static reflection map being black.
Browse files Browse the repository at this point in the history
Even if disabled in config, the realtime envmap is fully rendered once after loading terrain, to provide static reflections.

Kudos to NegativeIce for reporting!
  • Loading branch information
ohlidalp authored and tritonas00 committed Mar 30, 2021
1 parent d9f5034 commit 82689ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/main/GameContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ bool GameContext::LoadTerrain(std::string const& filename_part)
// Initialize envmap textures by rendering center of map
Ogre::Vector3 center = App::GetSimTerrain()->getMaxTerrainSize() / 2;
center.y = App::GetSimTerrain()->GetHeightAt(center.x, center.z) + 1.0f;
App::GetGfxScene()->GetEnvMap().UpdateEnvMap(center, nullptr);
App::GetGfxScene()->GetEnvMap().UpdateEnvMap(center, /*gfx_actor:*/nullptr, /*full:*/true);

// Scan groundmodels
App::GetGuiManager()->GetFrictionSettings()->AnalyzeTerrain();
Expand Down
2 changes: 1 addition & 1 deletion source/main/gfx/EnvironmentMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void RoR::GfxEnvmap::UpdateEnvMap(Ogre::Vector3 center, GfxActor* gfx_actor, boo
{
// how many of the 6 render planes to update at once? Use cvar 'gfx_envmap_rate', unless instructed to do full render.
const int update_rate = full ? NUM_FACES : App::gfx_envmap_rate->GetInt();
if (!App::gfx_envmap_enabled->GetBool() || update_rate == 0)
if (!full && (!App::gfx_envmap_enabled->GetBool() || update_rate == 0))
{
return;
}
Expand Down

0 comments on commit 82689ca

Please # to comment.