Pull weather updates out of scene render

--HG--
branch : multipass-stereo
This commit is contained in:
kaetemi 2013-07-04 22:39:05 +02:00
parent 5c568c6ea0
commit bf8ad82e21

View file

@ -550,10 +550,9 @@ void renderScene(bool forceFullDetail, bool bloom)
}
// ***************************************************************************************************************************
// Render all scenes
void renderScene()
void updateWeather()
{
{
H_AUTO_USE ( RZ_Client_Main_Loop_Sky_And_Weather )
//HeightGrid.update(Scene->getCam().getPos());
@ -581,13 +580,11 @@ void renderScene()
}
#endif
ContinentMngr.getFogState(MainFog, LightCycleManager.getLightLevel(), LightCycleManager.getLightDesc().DuskRatio, LightCycleManager.getState(), View.viewPos(), MainFogState);
if (Driver->getPolygonMode() == UDriver::Filled)
{
Driver->clearZBuffer();
}
// TODO: ZBuffer clear was originally before this, but should not be necessary normally.
// The anim function renders new clouds. Ensure this does not break.
// These are old-style nel clouds.
#ifdef RENDER_CLOUDS
if (CloudScape != NULL && Filter3D[FilterCloud])
@ -608,6 +605,17 @@ void renderScene()
Driver->setPolygonMode(oldMode);
}
#endif
}
// ***************************************************************************************************************************
// Render all scenes
void renderScene()
{
if (Driver->getPolygonMode() == UDriver::Filled)
{
Driver->clearZBuffer();
}
// Sky is used to clear the frame buffer now, but if in line or point polygon mode, we should draw it
if (Driver->getPolygonMode() != UDriver::Filled)
{
@ -616,7 +624,7 @@ void renderScene()
Driver->clearBuffers (CRGBA(127, 127, 127));
}
}
}
// Update Filter Flags
Scene->enableElementRender(UScene::FilterAllMeshNoVP, Filter3D[FilterMeshNoVP]);
Scene->enableElementRender(UScene::FilterAllMeshVP, Filter3D[FilterMeshVP]);
@ -1542,6 +1550,9 @@ bool mainLoop()
}
#endif
// TODO: Verify that moving this out of renderScene does not negatively impact oversize screenshots.
updateWeather();
if (ClientCfg.Bloom)
{
// set bloom parameters before applying bloom effect