diff options
author | Runitai Linden <davep@lindenlab.com> | 2022-01-14 17:11:27 -0600 |
---|---|---|
committer | Runitai Linden <davep@lindenlab.com> | 2022-01-14 17:11:27 -0600 |
commit | 6aa4d06cb6b728beac15773e9f08a02e375893ea (patch) | |
tree | b3cda44317ac281fa9214514c7c1f7eca67a01f9 /indra/newview | |
parent | 04edc151851b7689853069b0748af9c64e94283f (diff) |
SL-16544 Fix for small rigged meshes disappearing at short distances (for real this time).
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llspatialpartition.h | 1 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 38 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 7 |
3 files changed, 30 insertions, 16 deletions
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 666c025347..afe24d7d1f 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -623,6 +623,7 @@ class LLVolumeGeometryManager: public LLGeometryManager virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); + virtual void addGeometryCount(LLSpatialGroup* group, U32& vertex_count, U32& index_count); U32 genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL rigged = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c49ac895ca..b99c8e2280 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5516,8 +5516,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) group->clearDrawMap(); - mFaceList.clear(); - U32 fullbright_count[2] = { 0 }; U32 bump_count[2] = { 0 }; U32 simple_count[2] = { 0 }; @@ -5693,12 +5691,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) continue; } - cur_total += facep->getGeomCount(); - - if (facep->hasGeometry() && + if (facep->hasGeometry() && (rigged || // <-- HACK FIXME -- getPixelArea might be incorrect for rigged objects facep->getPixelArea() > FORCE_CULL_AREA)) // <-- don't render tiny faces { + cur_total += facep->getGeomCount(); + const LLTextureEntry* te = facep->getTextureEntry(); LLViewerTexture* tex = facep->getTexture(); @@ -5947,7 +5945,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) group->setState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO); } - mFaceList.clear(); } void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) @@ -6781,6 +6778,30 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace return geometryBytes; } +void LLVolumeGeometryManager::addGeometryCount(LLSpatialGroup* group, U32& vertex_count, U32& index_count) +{ + //initialize to default usage for this partition + U32 usage = group->getSpatialPartition()->mBufferUsage; + + //for each drawable + for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter) + { + LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable(); + + if (!drawablep || drawablep->isDead()) + { + continue; + } + + if (drawablep->isAnimating()) + { //fall back to stream draw for animating verts + usage = GL_STREAM_DRAW_ARB; + } + } + + group->mBufferUsage = usage; +} + void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32 &index_count) { LL_PROFILE_ZONE_SCOPED; @@ -6788,11 +6809,10 @@ void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_coun //initialize to default usage for this partition U32 usage = group->getSpatialPartition()->mBufferUsage; - //clear off any old faces - mFaceList.clear(); + //clear off any old faces + mFaceList.clear(); //for each drawable - for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter) { LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d5f9772b85..d8315c9420 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2500,13 +2500,6 @@ void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera) group->updateDistance(camera); } - const F32 MINIMUM_PIXEL_AREA = 16.f; - - if (group->mPixelArea < MINIMUM_PIXEL_AREA) - { - return; - } - assertInitialized(); if (!group->getSpatialPartition()->mRenderByGroup) |