summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llvovolume.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 476c0eef15..8f0b233f01 100755..100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3357,6 +3357,13 @@ const LLMatrix4 LLVOVolume::getRenderMatrix() const
// children, and cost should only be increased for unique textures -Nyx
U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
{
+ /*****************************************************************
+ * This calculation should not be modified by third party viewers,
+ * since it is used to limit rendering and should be uniform for
+ * everyone. If you have suggested improvements, submit them to
+ * the official viewer for consideration.
+ *****************************************************************/
+
// Get access to params we'll need at various points.
// Skip if this is object doesn't have a volume (e.g. is an avatar).
BOOL has_volume = (getVolume() != NULL);
@@ -3430,7 +3437,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
{
// base cost is dependent on mesh complexity
// note that 3 is the highest LOD as of the time of this coding.
- S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(),3);
+ S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(), getLOD());
if ( size > 0)
{
if (gMeshRepo.getSkinInfo(volume_params.getSculptID(), this))
@@ -4722,10 +4729,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
if (pAvatarVO)
{
- pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes;
- pAvatarVO->mAttachmentGeometryBytes = llmax(pAvatarVO->mAttachmentGeometryBytes, 0);
- pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea;
- pAvatarVO->mAttachmentSurfaceArea = llmax(pAvatarVO->mAttachmentSurfaceArea, 0.f);
+ pAvatarVO->subtractAttachmentArea( group->mSurfaceArea );
}
group->mGeometryBytes = 0;
@@ -5279,24 +5283,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
if (pAvatarVO)
{
- if (pAvatarVO->mAttachmentGeometryBytes < 0)
- { // First time through value is -1
- pAvatarVO->mAttachmentGeometryBytes = group->mGeometryBytes;
- }
- else
- {
- pAvatarVO->mAttachmentGeometryBytes += group->mGeometryBytes;
- }
- if (pAvatarVO->mAttachmentSurfaceArea < 0.f)
- { // First time through value is -1
- pAvatarVO->mAttachmentSurfaceArea = group->mSurfaceArea;
- }
- else
- {
- pAvatarVO->mAttachmentSurfaceArea += group->mSurfaceArea;
+ pAvatarVO->addAttachmentArea( group->mSurfaceArea );
}
}
-}
static LLTrace::BlockTimerStatHandle FTM_REBUILD_MESH_FLUSH("Flush Mesh");