Added deletion tracking so when we delete a probe, it'll delete the prefilter/irrad bakes if they exist.

WIP of static cubemap bake(not working).
This commit is contained in:
Areloch 2018-12-07 00:30:08 -06:00
parent 1766e291ba
commit 1fc38d496f
5 changed files with 106 additions and 78 deletions

View file

@ -225,18 +225,20 @@ void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLigh
else
{
// Cull the lights using the frustum.
getSceneManager()->getContainer()->findObjectList( *frustum, lightMask, &activeLights );
if (enableZoneLightCulling)
{
for (U32 i = 0; i < activeLights.size(); ++i)
{
if (!getSceneManager()->mRenderedObjectsList.contains(activeLights[i]))
{
activeLights.erase(i);
--i;
}
}
}
getSceneManager()->getContainer()->findObjectList(*frustum, lightMask, &activeLights);
if (enableZoneLightCulling)
{
for (U32 i = 0; i < activeLights.size(); ++i)
{
if (!getSceneManager()->mRenderedObjectsList.contains(activeLights[i]))
{
activeLights.erase(i);
--i;
}
}
}
// Store the culling position for sun placement
// later... see setSpecialLight.
mCullPos = frustum->getPosition();
@ -246,10 +248,10 @@ void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLigh
// the shape bounds and can often get culled.
GameConnection *conn = GameConnection::getConnectionToServer();
if ( conn->getControlObject() )
if (conn->getControlObject())
{
GameBase *conObject = conn->getControlObject();
activeLights.push_back_unique( conObject );
activeLights.push_back_unique(conObject);
}
}