summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-xindra/newview/llviewerregion.cpp52
1 files changed, 27 insertions, 25 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index dd4ff50259..192a96a408 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1255,43 +1255,45 @@ U32 LLViewerRegion::getNumOfVisibleGroups() const
void LLViewerRegion::updateReflectionProbes()
{
-#if 1
- const F32 probe_spacing = 32.f;
- const F32 probe_radius = sqrtf((probe_spacing * 0.5f) * (probe_spacing * 0.5f) * 3.f);
- const F32 hover_height = 2.f;
+ static LLCachedControl<S32> automatic_probes(gSavedSettings, "RenderAutomaticReflectionProbes", 2);
+ if (automatic_probes > 0)
+ {
+ const F32 probe_spacing = 32.f;
+ const F32 probe_radius = sqrtf((probe_spacing * 0.5f) * (probe_spacing * 0.5f) * 3.f);
+ const F32 hover_height = 2.f;
- F32 start = probe_spacing * 0.5f;
+ F32 start = probe_spacing * 0.5f;
- U32 grid_width = REGION_WIDTH_METERS / probe_spacing;
+ U32 grid_width = REGION_WIDTH_METERS / probe_spacing;
- mReflectionMaps.resize(grid_width * grid_width);
+ mReflectionMaps.resize(grid_width * grid_width);
- F32 water_height = getWaterHeight();
- LLVector3 origin = getOriginAgent();
+ F32 water_height = getWaterHeight();
+ LLVector3 origin = getOriginAgent();
- for (U32 i = 0; i < grid_width; ++i)
- {
- F32 x = i * probe_spacing + start;
- for (U32 j = 0; j < grid_width; ++j)
+ for (U32 i = 0; i < grid_width; ++i)
{
- F32 y = j * probe_spacing + start;
+ F32 x = i * probe_spacing + start;
+ for (U32 j = 0; j < grid_width; ++j)
+ {
+ F32 y = j * probe_spacing + start;
- U32 idx = i * grid_width + j;
+ U32 idx = i * grid_width + j;
- if (mReflectionMaps[idx].isNull())
- {
- mReflectionMaps[idx] = gPipeline.mReflectionMapManager.addProbe();
- }
+ if (mReflectionMaps[idx].isNull())
+ {
+ mReflectionMaps[idx] = gPipeline.mReflectionMapManager.addProbe();
+ }
- LLVector3 probe_origin = LLVector3(x,y, llmax(water_height, mImpl->mLandp->resolveHeightRegion(x,y)));
- probe_origin.mV[2] += hover_height;
- probe_origin += origin;
+ LLVector3 probe_origin = LLVector3(x, y, llmax(water_height, mImpl->mLandp->resolveHeightRegion(x, y)));
+ probe_origin.mV[2] += hover_height;
+ probe_origin += origin;
- mReflectionMaps[idx]->mOrigin.load3(probe_origin.mV);
- mReflectionMaps[idx]->mRadius = probe_radius;
+ mReflectionMaps[idx]->mOrigin.load3(probe_origin.mV);
+ mReflectionMaps[idx]->mRadius = probe_radius;
+ }
}
}
-#endif
}
void LLViewerRegion::addToVOCacheTree(LLVOCacheEntry* entry)