summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2010-11-18 16:42:57 -0500
committerNyx (Neal Orman) <nyx@lindenlab.com>2010-11-18 16:42:57 -0500
commit5e57352e1295d33cf9815800393212824d53bb75 (patch)
treeb72aaeaf91e55ce3d143bf0757c899d6068deca2 /indra
parent57e5841a9c642e8f1044daf33f44ede173ef48b9 (diff)
SH-350 SH-351 SH-355 FIX Several fixes for ARC
Fixed the texture resolution calculation against the rounding errors we had before. Fixed the bug where linking prims changed the combined cost Fixed the bug where twisting was not computed properly Code reviewed by davep.
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/APR.cmake2
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake1
-rw-r--r--indra/cmake/ViewerMiscLibs.cmake1
-rw-r--r--indra/newview/llfloatertools.cpp35
-rw-r--r--indra/newview/llfloatertools.h1
-rw-r--r--indra/newview/llselectmgr.cpp27
-rw-r--r--indra/newview/llselectmgr.h1
-rw-r--r--indra/newview/llvovolume.cpp59
8 files changed, 51 insertions, 76 deletions
diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake
index 180504d286..b6f1e06edd 100644
--- a/indra/cmake/APR.cmake
+++ b/indra/cmake/APR.cmake
@@ -56,7 +56,7 @@ else (STANDALONE)
if (LINUX)
if (VIEWER)
- list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
+ list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})
endif (VIEWER)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)
endif (LINUX)
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 9081752287..798cf9af14 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -241,7 +241,6 @@ elseif(LINUX)
libstacktrace.so
libtcmalloc_minimal.so
libtcmalloc_minimal.so.0
- libuuid.so.1
libssl.so.0.9.7
)
diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake
index 32c4bc81df..5710360de2 100644
--- a/indra/cmake/ViewerMiscLibs.cmake
+++ b/indra/cmake/ViewerMiscLibs.cmake
@@ -2,7 +2,6 @@
include(Prebuilt)
if (NOT STANDALONE)
- use_prebuilt_binary(libuuid)
use_prebuilt_binary(vivox)
use_prebuilt_binary(fontconfig)
endif(NOT STANDALONE)
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index b9b94488cf..920bdef7f6 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -450,7 +450,8 @@ void LLFloaterTools::refresh()
if (sShowObjectCost)
{
std::string prim_cost_string;
- LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
+ S32 cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+ LLResMgr::getInstance()->getIntegerString(prim_cost_string, cost);
getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string);
}
@@ -1000,38 +1001,6 @@ void LLFloaterTools::onClickGridOptions()
//floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
}
-S32 LLFloaterTools::calcRenderCost()
-{
- S32 cost = 0;
- LLVOVolume::texture_cost_t textures;
-
- for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin();
- selection_iter != LLSelectMgr::getInstance()->getSelection()->end();
- ++selection_iter)
- {
- LLSelectNode *select_node = *selection_iter;
- if (select_node)
- {
- LLViewerObject *vobj = select_node->getObject();
- if (vobj->getVolume())
- {
- LLVOVolume* volume = (LLVOVolume*) vobj;
-
- cost += volume->getRenderCost(textures);
- for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
- {
- // add the cost of each individual texture in the linkset
- cost += iter->second;
- }
- textures.clear();
- }
- }
- }
-
-
- return cost;
-}
-
// static
void LLFloaterTools::setEditTool(void* tool_pointer)
{
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 87c3d2ab47..d5595445e0 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -114,7 +114,6 @@ private:
static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
static void setObjectType( LLPCode pcode );
void onClickGridOptions();
- S32 calcRenderCost();
public:
LLButton *mBtnFocus;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 728694117c..eb1ca66334 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6335,6 +6335,33 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount()
return count;
}
+S32 LLObjectSelection::getSelectedObjectRenderCost()
+{
+ S32 cost = 0;
+ LLVOVolume::texture_cost_t textures;
+ for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
+ {
+ LLSelectNode* node = *iter;
+ LLVOVolume* object = (LLVOVolume*)node->getObject();
+
+ if (object)
+ {
+ cost += object->getRenderCost(textures);
+ }
+
+ for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+ {
+ // add the cost of each individual texture in the linkset
+ cost += iter->second;
+ llinfos << "adding texture cost of: " << iter->second << llendl;
+ }
+ textures.clear();
+ }
+
+
+ return cost;
+}
+
//-----------------------------------------------------------------------------
// getTECount()
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index e0f76bd5dd..0cf582062d 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -284,6 +284,7 @@ public:
F32 getSelectedLinksetCost();
F32 getSelectedPhysicsCost();
F32 getSelectedLinksetPhysicsCost();
+ S32 getSelectedObjectRenderCost();
F32 getSelectedObjectStreamingCost();
U32 getSelectedObjectTriangleCount();
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index fe11570cf6..9aebfcba4a 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2940,15 +2940,18 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
U32 flexi = 0;
U32 animtex = 0;
U32 particles = 0;
- U32 scale = 0;
U32 bump = 0;
U32 planar = 0;
U32 cuts = 0;
U32 hollow = 0;
- U32 twist = 0;
U32 circular_profile = 0;
U32 circular_path = 0;
+ // these multipliers are variable and can be floating point
+ F32 scale = 0.f;
+ F32 twist = 0.f;
+
+
const LLDrawable* drawablep = mDrawable;
if (isSculpted())
@@ -2992,7 +2995,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id);
if (texture)
{
- S32 texture_cost = ARC_TEXTURE_COST * (texture->getFullHeight() / 128 + texture->getFullWidth() / 128 + 1);
+ S32 texture_cost = (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f + 1));
textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost));
}
}
@@ -3009,11 +3012,11 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
}
const LLVector3& sc = getScale();
- scale += (U32) sc.mV[0] + (U32) sc.mV[1] + (U32) sc.mV[2];
- if (scale > 4)
+ scale += sc.mV[0] + sc.mV[1] + sc.mV[2];
+ if (scale > 4.f)
{
// scale is a multiplier, cap it at 4.
- scale = 4;
+ scale = 4.f;
}
// add points for cut prims
@@ -3033,19 +3036,15 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
hollow = 1;
}
- // twist - scale by twist extent / 90
- if (volume_params.getTwistBegin() != 0.f)
+ F32 twist_mag = path_params.getTwistBegin() - path_params.getTwistEnd();
+ if (twist_mag < 0)
{
- U32 scale = abs((S32)(volume_params.getTwistBegin() / 90.f) + 1);
- twist += scale;
+ twist_mag *= -1.f;
}
- // twist - scale by twist extent / 90
- if (volume_params.getTwist() != 0.f)
- {
- U32 scale = abs((S32)(volume_params.getTwist() / 90.f) + 1);
- twist += scale;
- }
+ // note magnitude of twist is [-1.f, 1.f]. which translates to [-180, 180] degrees.
+ // scale to degrees / 90 by multiplying by 2.
+ twist = twist_mag * 2.f;
// double cost for circular profiles / sculpties
if (profile_params.getCurveType() == LL_PCODE_PROFILE_CIRCLE ||
@@ -3079,7 +3078,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
{
if (textures.find(img->getID()) == textures.end())
{
- S32 texture_cost = ARC_TEXTURE_COST * (img->getFullHeight() / 128 + img->getFullWidth() / 128 + 1);
+ S32 texture_cost = (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f + 1));
textures.insert(texture_cost_t::value_type(img->getID(), texture_cost));
}
}
@@ -3136,9 +3135,9 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
shame *= hollow * ARC_HOLLOW_MULT;
}
- if (twist)
+ if (twist > 1.f)
{
- shame *= twist;
+ shame = (U32)(shame * twist);
}
if (circular_profile)
@@ -3171,33 +3170,15 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
shame *= shiny * ARC_SHINY_MULT;
}
- if (scale)
+ if (scale > 1.f)
{
- shame *= scale;
+ shame = (U32)(shame *scale);
}
// add additional costs
shame += particles * ARC_PARTICLE_COST;
- LLViewerObject::const_child_list_t& child_list = getChildren();
- for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
- iter != child_list.end();
- ++iter)
- {
- const LLViewerObject* child_objectp = *iter;
- const LLDrawable* child_drawablep = child_objectp->mDrawable;
- if (child_drawablep)
- {
- const LLVOVolume* child_volumep = child_drawablep->getVOVolume();
- if (child_volumep)
- {
- shame += child_volumep->getRenderCost(textures);
- }
- }
- }
-
return shame;
-
}
F32 LLVOVolume::getStreamingCost()