diff options
author | max nikolenko <maximnproductengine@lindenlab.com> | 2016-11-16 17:48:15 +0000 |
---|---|---|
committer | max nikolenko <maximnproductengine@lindenlab.com> | 2016-11-16 17:48:15 +0000 |
commit | 30c8ea4d2c0c48e18835c32dafc35d3e16a2b2d9 (patch) | |
tree | c7bc86e8b1d4d778bc489b7104aa596a5d1a062a /indra/newview/llvovolume.cpp | |
parent | deb8f582c56bd6035f9f2c3d57b8865a1c928936 (diff) | |
parent | 4040b452a37622feec0ad1d4eeb0492c636d1cd5 (diff) |
Merged in MAINT-6872
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8c026bae21..6d57526c7d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1213,18 +1213,18 @@ void LLVOVolume::sculpt() } } -S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) +S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius, F32 lod_factor) { S32 cur_detail; if (LLPipeline::sDynamicLOD) { // We've got LOD in the profile, and in the twist. Use radius. - F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance; + F32 tan_angle = (lod_factor*radius)/distance; cur_detail = LLVolumeLODGroup::getDetailFromTan(ll_round(tan_angle, 0.01f)); } else { - cur_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3); + cur_detail = llclamp((S32) (sqrtf(radius)*lod_factor*4.f), 0, 3); } return cur_detail; } @@ -1240,6 +1240,7 @@ BOOL LLVOVolume::calcLOD() F32 radius; F32 distance; + F32 lod_factor = LLVOVolume::sLODFactor; if (mDrawable->isState(LLDrawable::RIGGED)) { @@ -1275,12 +1276,18 @@ BOOL LLVOVolume::calcLOD() distance *= rampDist; } - // DON'T Compensate for field of view changing on FOV zoom. + distance *= F_PI/3.f; - cur_detail = computeLODDetail(ll_round(distance, 0.01f), - ll_round(radius, 0.01f)); + static LLCachedControl<bool> ignore_fov_zoom(gSavedSettings,"IgnoreFOVZoomForLODs"); + if(!ignore_fov_zoom) + { + lod_factor *= DEFAULT_FIELD_OF_VIEW / LLViewerCamera::getInstance()->getDefaultFOV(); + } + cur_detail = computeLODDetail(ll_round(distance, 0.01f), + ll_round(radius, 0.01f), + lod_factor); if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && mDrawable->getFace(0)) |