Skip to content
Permalink
Browse files
When initializing, weight reflector priority more highly, and skip ou…
…t on occlusion testing.
  • Loading branch information
Azaezel committed Sep 29, 2015
1 parent 2044b26 commit 902696e75403b6e72556937a9f98cac4cc9e950e
Showing with 14 additions and 8 deletions.
  1. +13 −8 Engine/source/scene/reflector.cpp
  2. +1 −0 Engine/source/scene/reflector.h
@@ -174,6 +174,7 @@ ReflectorBase::ReflectorBase()
{
mEnabled = false;
mOccluded = false;
mInitializing = true;
mIsRendering = false;
mDesc = NULL;
mObject = NULL;
@@ -224,14 +225,17 @@ F32 ReflectorBase::calcScore( const ReflectParams &params )
}
}

// If we're disabled for any reason then there
// is nothing more left to do.
if ( !mEnabled ||
mOccluded ||
params.culler.isCulled( mObject->getWorldBox() ) )
if (!mInitializing)
{
score = 0;
return score;
// If we're disabled for any reason then there
// is nothing more left to do.
if (!mEnabled ||
mOccluded ||
params.culler.isCulled(mObject->getWorldBox()))
{
score = 0;
return score;
}
}

// This mess is calculating a score based on LOD.
@@ -245,8 +249,9 @@ F32 ReflectorBase::calcScore( const ReflectParams &params )
F32 sizeSS = sizeWS / dist * worldToScreenScaleY;
*/

if ( mDesc->priority == -1.0f )
if ( mDesc->priority == -1.0f || mInitializing )
{
mInitializing = false;
score = 1000.0f;
return score;
}
@@ -109,6 +109,7 @@ class ReflectorBase
/// does not need to be submitted.
bool mQueryPending;

bool mInitializing;
protected:

bool mEnabled;

0 comments on commit 902696e

Please sign in to comment.