diff options
Diffstat (limited to 'indra/newview/llsurfacepatch.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llsurfacepatch.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 1d57e27616..2d06b8599c 100644..100755 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -33,7 +33,6 @@ #include "llsurface.h" #include "pipeline.h" #include "llagent.h" -#include "timing.h" #include "llsky.h" #include "llviewercamera.h" @@ -43,11 +42,12 @@ #include "lldrawpool.h" #include "noise.h" -extern U64 gFrameTime; +extern bool gShiftFrame; +extern U64MicrosecondsImplicit gFrameTime; extern LLPipeline gPipeline; -LLSurfacePatch::LLSurfacePatch() : - mHasReceivedData(FALSE), +LLSurfacePatch::LLSurfacePatch() +: mHasReceivedData(FALSE), mSTexUpdate(FALSE), mDirty(FALSE), mDirtyZStats(TRUE), @@ -99,7 +99,7 @@ void LLSurfacePatch::dirty() } else { - llwarns << "No viewer object for this surface patch!" << llendl; + LL_WARNS() << "No viewer object for this surface patch!" << LL_ENDL; } mDirtyZStats = TRUE; @@ -218,7 +218,7 @@ void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 pos_agent.mV[VX] += x * mSurfacep->getMetersPerGrid(); pos_agent.mV[VY] += y * mSurfacep->getMetersPerGrid(); pos_agent.mV[VZ] = *(mDataZ + point_offset); - *vertex = pos_agent; + *vertex = pos_agent-mVObjp->getRegion()->getOriginAgent(); LLVector3 rel_pos = pos_agent - mSurfacep->getOriginAgent(); LLVector3 tex_pos = rel_pos * (1.f/surface_stride); @@ -366,10 +366,13 @@ void LLSurfacePatch::updateCameraDistanceRegion(const LLVector3 &pos_region) { if (LLPipeline::sDynamicLOD) { - LLVector3 dv = pos_region; - dv -= mCenterRegion; - mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius))/ - llmax(LLVOSurfacePatch::sLODFactor, 0.1f); + if (!gShiftFrame) + { + LLVector3 dv = pos_region; + dv -= mCenterRegion; + mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius))/ + llmax(LLVOSurfacePatch::sLODFactor, 0.1f); + } } else { @@ -854,8 +857,10 @@ void LLSurfacePatch::updateVisibility() F32 stride_per_distance = DEFAULT_DELTA_ANGLE / mSurfacep->getMetersPerGrid(); U32 grids_per_patch_edge = mSurfacep->getGridsPerPatchEdge(); - LLVector3 center = mCenterRegion + mSurfacep->getOriginAgent(); - LLVector3 radius = LLVector3(mRadius, mRadius, mRadius); + LLVector4a center; + center.load3( (mCenterRegion + mSurfacep->getOriginAgent()).mV); + LLVector4a radius; + radius.splat(mRadius); // sphere in frustum on global coordinates if (LLViewerCamera::getInstance()->AABBInFrustumNoFarClip(center, radius)) |