diff options
| author | Dave Parks <davep@lindenlab.com> | 2023-04-08 11:22:50 -0500 | 
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2023-04-08 11:22:50 -0500 | 
| commit | 474739226433a74cdca05a949586139a9c9c0bbd (patch) | |
| tree | f14cb0756ca5ab1eef60c50d1039815247b7bb07 | |
| parent | 413ce656c8e910bf3758afc3fa354e07be2d4561 (diff) | |
SL-19538 Nudge probe scheduler to unstick probes that are "complete".
| -rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 17 | 
1 files changed, 14 insertions, 3 deletions
| diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index fd80936496..ea2db63560 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -75,6 +75,11 @@ struct CompareProbeDistance      }  }; +static F32 update_score(LLReflectionMap* p) +{ +    return gFrameTimeSeconds - p->mLastUpdateTime  - p->mDistance*0.1f; +} +  // return true if a is higher priority for an update than b  static bool check_priority(LLReflectionMap* a, LLReflectionMap* b)  { @@ -83,9 +88,8 @@ static bool check_priority(LLReflectionMap* a, LLReflectionMap* b)          return a->mDistance < b->mDistance;      }      else if (a->mComplete && b->mComplete) -    { //both probes are complete, use combination of distance and last update time -        return (a->mDistance - (gFrameTimeSeconds - a->mLastUpdateTime)) < -            (b->mDistance - (gFrameTimeSeconds - b->mLastUpdateTime)); +    { //both probes are complete, use update_score metric +        return update_score(a) > update_score(b);      }      // one of these probes is not complete, if b is complete, a is higher priority @@ -203,9 +207,15 @@ void LLReflectionMapManager::update()              d.setSub(camera_pos, probe->mOrigin);              probe->mDistance = d.getLength3().getF32() - probe->mRadius;          } +        else if (probe->mComplete) +        { +            // make default probe have a distance of 64m for the purposes of prioritization (if it's already been generated once) +            probe->mDistance = 64.f; +        }          if (probe->mComplete)          { +            probe->autoAdjustOrigin();              probe->mFadeIn = llmin((F32) (probe->mFadeIn + gFrameIntervalSeconds), 1.f);          }          if (probe->mOccluded && probe->mComplete) @@ -285,6 +295,7 @@ void LLReflectionMapManager::update()      }      // update distance to camera for all probes +    mDefaultProbe->mDistance = -4096.f; // make default probe always end up at index 0      std::sort(mProbes.begin(), mProbes.end(), CompareProbeDistance());  } | 
