Overhauls the handling of probes to utilize an active probe list to improve performance and allow a greater total number of active probes in a scene.

Also fixes handling of metal materials during bakes to render properly, and fixes a possible double-up return in findObjectByType, which could cause doubling when getting probes in the scene
This commit is contained in:
Areloch 2020-10-19 00:53:09 -05:00
parent 072b5ecb19
commit 6a3603c737
22 changed files with 490 additions and 610 deletions

View file

@ -295,7 +295,7 @@ void CubeReflector::unregisterReflector()
mEnabled = false;
}
void CubeReflector::updateReflection( const ReflectParams &params )
void CubeReflector::updateReflection( const ReflectParams &params, Point3F explicitPostion)
{
GFXDEBUGEVENT_SCOPE( CubeReflector_UpdateReflection, ColorI::WHITE );
@ -336,7 +336,7 @@ void CubeReflector::updateReflection( const ReflectParams &params )
for ( U32 i = 0; i < 6; i++ )
updateFace( params, i );
updateFace( params, i, explicitPostion);
GFX->popActiveRenderTarget();
@ -347,7 +347,7 @@ void CubeReflector::updateReflection( const ReflectParams &params )
mLastTexSize = texDim;
}
void CubeReflector::updateFace( const ReflectParams &params, U32 faceidx )
void CubeReflector::updateFace( const ReflectParams &params, U32 faceidx, Point3F explicitPostion)
{
GFXDEBUGEVENT_SCOPE( CubeReflector_UpdateFace, ColorI::WHITE );
@ -402,7 +402,15 @@ void CubeReflector::updateFace( const ReflectParams &params, U32 faceidx )
matView.setColumn( 0, cross );
matView.setColumn( 1, vLookatPt );
matView.setColumn( 2, vUpVec );
matView.setPosition( mObject->getPosition() );
if (explicitPostion == Point3F::Max)
{
matView.setPosition(mObject->getPosition());
}
else
{
matView.setPosition(explicitPostion);
}
matView.inverse();
GFX->setWorldMatrix(matView);