mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
registergloballights now taks a (by default on) cullSceneLights. off for reflection capture as that is presently acting up
This commit is contained in:
parent
9d1e49a8eb
commit
8590f7daf9
4 changed files with 15 additions and 14 deletions
|
|
@ -198,7 +198,7 @@ void LightManager::setSpecialLight( LightManager::SpecialLightTypesEnum type, Li
|
||||||
registerGlobalLight( light, NULL );
|
registerGlobalLight( light, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLighting )
|
void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLighting, bool cullSceneLights)
|
||||||
{
|
{
|
||||||
PROFILE_SCOPE( LightManager_RegisterGlobalLights );
|
PROFILE_SCOPE( LightManager_RegisterGlobalLights );
|
||||||
|
|
||||||
|
|
@ -226,16 +226,17 @@ void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLigh
|
||||||
{
|
{
|
||||||
// Cull the lights using the frustum.
|
// Cull the lights using the frustum.
|
||||||
getSceneManager()->getContainer()->findObjectList( *frustum, lightMask, &activeLights );
|
getSceneManager()->getContainer()->findObjectList( *frustum, lightMask, &activeLights );
|
||||||
|
if (cullSceneLights)
|
||||||
for (U32 i = 0; i < activeLights.size(); ++i)
|
{
|
||||||
{
|
for (U32 i = 0; i < activeLights.size(); ++i)
|
||||||
if (!getSceneManager()->mRenderedObjectsList.contains(activeLights[i]))
|
{
|
||||||
{
|
if (!getSceneManager()->mRenderedObjectsList.contains(activeLights[i]))
|
||||||
activeLights.erase(i);
|
{
|
||||||
--i;
|
activeLights.erase(i);
|
||||||
}
|
--i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Store the culling position for sun placement
|
// Store the culling position for sun placement
|
||||||
// later... see setSpecialLight.
|
// later... see setSpecialLight.
|
||||||
mCullPos = frustum->getPosition();
|
mCullPos = frustum->getPosition();
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ public:
|
||||||
virtual void registerLocalLight( LightInfo *light );
|
virtual void registerLocalLight( LightInfo *light );
|
||||||
virtual void unregisterLocalLight( LightInfo *light );
|
virtual void unregisterLocalLight( LightInfo *light );
|
||||||
|
|
||||||
virtual void registerGlobalLights( const Frustum *frustum, bool staticlighting );
|
virtual void registerGlobalLights( const Frustum *frustum, bool staticlighting, bool cullSceneLights = true );
|
||||||
virtual void unregisterAllLights();
|
virtual void unregisterAllLights();
|
||||||
|
|
||||||
/// Returns all unsorted and un-scored lights (both global and local).
|
/// Returns all unsorted and un-scored lights (both global and local).
|
||||||
|
|
|
||||||
|
|
@ -422,7 +422,7 @@ void CubeReflector::updateFace( const ReflectParams ¶ms, U32 faceidx )
|
||||||
reflectRenderState.setDiffuseCameraTransform( params.query->headMatrix );
|
reflectRenderState.setDiffuseCameraTransform( params.query->headMatrix );
|
||||||
|
|
||||||
// render scene
|
// render scene
|
||||||
LIGHTMGR->registerGlobalLights( &reflectRenderState.getCullingFrustum(), false );
|
LIGHTMGR->registerGlobalLights( &reflectRenderState.getCullingFrustum(), false, false );
|
||||||
gClientSceneGraph->renderSceneNoLights( &reflectRenderState, mDesc->objectTypeMask );
|
gClientSceneGraph->renderSceneNoLights( &reflectRenderState, mDesc->objectTypeMask );
|
||||||
LIGHTMGR->unregisterAllLights();
|
LIGHTMGR->unregisterAllLights();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ void SceneManager::renderScene( SceneRenderState* renderState, U32 objectMask, S
|
||||||
// Get the lights for rendering the scene.
|
// Get the lights for rendering the scene.
|
||||||
|
|
||||||
PROFILE_START( SceneGraph_registerLights );
|
PROFILE_START( SceneGraph_registerLights );
|
||||||
LIGHTMGR->registerGlobalLights( &renderState->getCullingFrustum(), false );
|
LIGHTMGR->registerGlobalLights( &renderState->getCullingFrustum(), false, renderState->isDiffusePass());
|
||||||
PROFILE_END();
|
PROFILE_END();
|
||||||
|
|
||||||
// If its a diffuse pass, update the current ambient light level.
|
// If its a diffuse pass, update the current ambient light level.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue