diff options
author | Dave Parks <davep@lindenlab.com> | 2012-04-19 17:29:32 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2012-04-19 17:29:32 -0500 |
commit | d953cce3868cf53b3f84e1fdd97119c83d3dff7d (patch) | |
tree | 3968b54b780ee7849d35acdeffb034d11eba65f8 /indra | |
parent | 5334c410ea7552ebc2c758ee8911b3235f76824a (diff) |
MAINT-775 Cleanup of some weird corner cases on animated child prims.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 12 | ||||
-rw-r--r-- | indra/newview/lldrawable.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llvovolume.h | 2 |
5 files changed, 74 insertions, 14 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index bed139d9df..c3fb23750f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8060,6 +8060,18 @@ <real>0</real> </map> + <key>RenderDepthPrePass</key> + <map> + <key>Comment</key> + <string>EXPERIMENTAL: Prime the depth buffer with simple prim geometry before rendering with textures.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>RenderDepthOfField</key> <map> <key>Comment</key> diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 3b55ac4a3b..e06242055c 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -182,7 +182,7 @@ LLVOVolume* LLDrawable::getVOVolume() const const LLMatrix4& LLDrawable::getRenderMatrix() const { - return isRoot() || isState(LLDrawable::ANIMATED_CHILD) ? getWorldMatrix() : getParent()->getWorldMatrix(); + return isRoot() ? getWorldMatrix() : getParent()->getWorldMatrix(); } BOOL LLDrawable::isLight() const @@ -538,13 +538,12 @@ F32 LLDrawable::updateXform(BOOL undamped) target_rot = new_rot; target_scale = new_scale; } - else + else if (mVObjp->getAngularVelocity().isExactlyZero()) { - // snap to final position + // snap to final position (only if no target omega is applied) dist_squared = 0.0f; - if (getVOVolume() && !isRoot() && !isState(LLDrawable::ANIMATED_CHILD)) + if (getVOVolume() && !isRoot()) { //child prim snapping to some position, needs a rebuild - setState(LLDrawable::ANIMATED_CHILD); gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } } @@ -558,8 +557,7 @@ F32 LLDrawable::updateXform(BOOL undamped) gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } else if (!isRoot() && - (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED || - !mVObjp->getAngularVelocity().isExactlyZero() || + (!mVObjp->getAngularVelocity().isExactlyZero() || target_pos != mXform.getPosition() || target_rot != mXform.getRotation())) { //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 0adb187dd2..001d8e184a 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -889,6 +889,28 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; LLMemType mt_rg(LLMemType::MTYPE_DISPLAY_RENDER_GEOM); + + if (gSavedSettings.getBOOL("RenderDepthPrePass") && LLGLSLShader::sNoFixedFunction) + { + gGL.setColorMask(false, false); + + U32 types[] = { + LLRenderPass::PASS_SIMPLE, + LLRenderPass::PASS_FULLBRIGHT, + LLRenderPass::PASS_SHINY + }; + + U32 num_types = LL_ARRAY_SIZE(types); + gOcclusionProgram.bind(); + for (U32 i = 0; i < num_types; i++) + { + gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE); + } + + gOcclusionProgram.unbind(); + } + + gGL.setColorMask(true, false); if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 102fe4bab6..847a3767bc 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -684,7 +684,7 @@ void LLVOVolume::updateTextures() { updateTextureVirtualSize(); - if (mDrawable.notNull() && !isVisible()) + if (mDrawable.notNull() && !isVisible() && !mDrawable->isActive()) { //delete vertex buffer to free up some VRAM LLSpatialGroup* group = mDrawable->getSpatialGroup(); if (group) @@ -1438,7 +1438,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global) BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED); -// bool rigged = false; + // bool rigged = false; LLVolume* volume = mRiggedVolume; if (!volume) { @@ -1493,7 +1493,7 @@ void LLVOVolume::preRebuild() } } -void LLVOVolume::updateRelativeXform() +void LLVOVolume::updateRelativeXform(bool force_identity) { if (mVolumeImpl) { @@ -1517,14 +1517,14 @@ void LLVOVolume::updateRelativeXform() mRelativeXform.invert(); mRelativeXformInvTrans.transpose(); } - else if (drawable->isActive()) + else if (drawable->isActive() || force_identity) { // setup relative transforms LLQuaternion delta_rot; LLVector3 delta_pos, delta_scale; //matrix from local space to parent relative/global space - bool use_identity = drawable->isSpatialRoot() || drawable->isState(LLDrawable::ANIMATED_CHILD); + bool use_identity = force_identity || drawable->isSpatialRoot(); delta_rot = use_identity ? LLQuaternion() : mDrawable->getRotation(); delta_pos = use_identity ? LLVector3(0,0,0) : mDrawable->getPosition(); delta_scale = mDrawable->getScale(); @@ -3969,7 +3969,14 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, if (drawable->isActive()) { - model_mat = &drawable->getRenderMatrix(); + if (drawable->isState(LLDrawable::ANIMATED_CHILD)) + { + model_mat = &drawable->getWorldMatrix(); + } + else + { + model_mat = &drawable->getRenderMatrix(); + } } else { @@ -4618,6 +4625,11 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) LLVOVolume* vobj = drawablep->getVOVolume(); vobj->preRebuild(); + if (drawablep->isState(LLDrawable::ANIMATED_CHILD)) + { + vobj->updateRelativeXform(true); + } + LLVolume* volume = vobj->getVolume(); for (S32 i = 0; i < drawablep->getNumFaces(); ++i) { @@ -4637,6 +4649,12 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) } } } + + if (drawablep->isState(LLDrawable::ANIMATED_CHILD)) + { + vobj->updateRelativeXform(); + } + drawablep->clearState(LLDrawable::REBUILD_ALL); } @@ -4951,10 +4969,20 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: LLVOVolume* vobj = drawablep->getVOVolume(); LLVolume* volume = vobj->getVolume(); + if (drawablep->isState(LLDrawable::ANIMATED_CHILD)) + { + vobj->updateRelativeXform(true); + } + U32 te_idx = facep->getTEOffset(); facep->getGeometryVolume(*volume, te_idx, vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset); + + if (drawablep->isState(LLDrawable::ANIMATED_CHILD)) + { + vobj->updateRelativeXform(false); + } } } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 3cf434dc26..b2873c9894 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -203,7 +203,7 @@ public: LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status); - void updateRelativeXform(); + void updateRelativeXform(bool force_identity = false); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); /*virtual*/ void updateFaceSize(S32 idx); /*virtual*/ BOOL updateLOD(); |