diff --git a/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp b/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp index 85addbdc00f..063a2542628 100644 --- a/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp +++ b/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp @@ -1511,11 +1511,15 @@ namespace Ogre mAreaLights.reserve( numAreaApproxLights ); mAreaLights.clear(); const LightListInfo &globalLightList = sceneManager->getGlobalLightList(); - for( size_t i=0; igetType() == Light::LT_AREA_APPROX ); - mAreaLights.push_back( globalLightList.lights[idx] ); + size_t areaLightNumber = 0; + for( size_t idx = mAreaLightsGlobalLightListStart; + idxgetType() == Light::LT_AREA_APPROX ) + { + mAreaLights.push_back( globalLightList.lights[idx] ); + areaLightNumber++; + } } std::sort( mAreaLights.begin(), mAreaLights.end(), SortByTextureLightMaskIdx );