summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llreflectionmap.cpp')
-rw-r--r--indra/newview/llreflectionmap.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index c2cb8f183a..07c712a9a6 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -158,6 +158,10 @@ void LLReflectionMap::autoAdjustOrigin()
}
mRadius = llmax(sqrtf(r2.getF32()), 8.f);
+
+ // make sure near clip doesn't poke through ground
+ fp[2] = llmax(fp[2], height+mRadius*0.5f);
+
}
}
else if (mViewerObject)
@@ -205,6 +209,14 @@ F32 LLReflectionMap::getNearClip()
{
ret = ((LLVOVolume*)mViewerObject)->getReflectionProbeNearClip();
}
+ else if (mGroup)
+ {
+ ret = mRadius * 0.5f; // default to half radius for automatic object probes
+ }
+ else
+ {
+ ret = 1.f; // default to 1m for automatic terrain probes
+ }
return llmax(ret, MINIMUM_NEAR_CLIP);
}