Skip to content
Snippets Groups Projects
Commit b62b79a6 authored by D-AIRY's avatar D-AIRY
Browse files

Do not update visibility for cached lights

parent 4dcd1cd1
No related branches found
No related tags found
No related merge requests found
......@@ -584,7 +584,7 @@ void XMETHODCALLTYPE CLightSystem::updateVisibility()
for(UINT i = 0, l = m_aLights.size(); i < l; ++i)
{
if(m_aLights[i]->isEnabled())
if(m_aLights[i]->isEnabled() && m_aLights[i]->isDirty(LRT_ALL))
{
m_aLights[i]->updateVisibility(m_pMainCamera, vLPVmin, vLPVmax, iCascades > 0);
}
......
......@@ -205,6 +205,10 @@ protected:
{
m_aMapsQueue[uMap]->isDirty = true;
m_aMapsQueue[uMap]->shouldProcess = true;
if(m_aMapsQueue[uMap]->pLight)
{
m_aMapsQueue[uMap]->pLight->markDirty(m_renderType);
}
m_aMapsQueue[uMap]->pLight = m_aFrameLights[i];
m_aFrameLights.erase(i);
return(true);
......
......@@ -81,6 +81,10 @@ public:
{
m_dirty &= ~type;
}
void markDirty(LIGHT_RENDER_TYPE type)
{
m_dirty |= type;
}
protected:
virtual SMMATRIX getWorldTM();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment