diff options
author | Tofu Buzzard <no-email> | 2011-03-11 19:18:34 -0800 |
---|---|---|
committer | Tofu Buzzard <no-email> | 2011-03-11 19:18:34 -0800 |
commit | 0b51a0cc63b5d6cd848189bf3fc0d26e987c62fb (patch) | |
tree | 5f6ab56dc3eeeedd27099a5cd5a75a72b9fae059 | |
parent | c1f01016cfc4dd908c1f73b815cddb1b6b35194d (diff) | |
parent | 41f057b693d1b2b1b1916e3a126dc622a943e5d8 (diff) |
merge
-rw-r--r-- | .hgtags | 1 | ||||
-rw-r--r-- | indra/llcommon/llversionviewer.h | 2 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 2 | ||||
-rwxr-xr-x | indra/newview/llmeshrepository.cpp | 39 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvovolume.h | 2 |
7 files changed, 70 insertions, 18 deletions
@@ -73,3 +73,4 @@ b723921b5c711bd24dbe77dc76ef488b544dac78 2.5.0-release b723921b5c711bd24dbe77dc76ef488b544dac78 DRTVWR-31_2.5.0-release 92e58e51776a4f8c29069b1a62ff21454d2085f0 2.6.0-start 63a6aedfce785a6c760377bf685b2dae616797d2 2.5.1-start +4dede9ae1ec74d41f6887719f6f1de7340d8578d 2.5.1-release diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 15e3ffe1da..3838b2b16c 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -29,7 +29,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 5; -const S32 LL_VERSION_PATCH = 2; +const S32 LL_VERSION_PATCH = 3; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 05096fdec9..9878729884 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8930,7 +8930,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.125</real> + <real>2.0</real> </map> <key>MeshThreadCount</key> <map> diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 6c647eb9da..a9a8e28b00 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -3100,9 +3100,7 @@ F32 LLMeshRepository::getStreamingCost(const LLSD& header, F32 radius) F32 dlowest = llmin(radius/0.06f, 256.f); F32 dlow = llmin(radius/0.24f, 256.f); F32 dmid = llmin(radius/1.0f, 256.f); - F32 dhigh = 0.f; - - + F32 bytes_lowest = header["lowest_lod"]["size"].asReal()/1024.f; F32 bytes_low = header["low_lod"]["size"].asReal()/1024.f; F32 bytes_mid = header["medium_lod"]["size"].asReal()/1024.f; @@ -3128,14 +3126,35 @@ F32 LLMeshRepository::getStreamingCost(const LLSD& header, F32 radius) bytes_lowest = bytes_low; } - F32 cost = 0.f; - cost += llmax(256.f-dlowest, 1.f)/32.f*bytes_lowest; - cost += llmax(dlowest-dlow, 1.f)/32.f*bytes_low; - cost += llmax(dlow-dmid, 1.f)/32.f*bytes_mid; - cost += llmax(dmid-dhigh, 1.f)/32.f*bytes_high; + F32 max_area = 65536.f; + F32 min_area = 1.f; + + F32 high_area = llmin(F_PI*dmid*dmid, max_area); + F32 mid_area = llmin(F_PI*dlow*dlow, max_area); + F32 low_area = llmin(F_PI*dlowest*dlowest, max_area); + F32 lowest_area = max_area; + + lowest_area -= low_area; + low_area -= mid_area; + mid_area -= high_area; + + high_area = llclamp(high_area, min_area, max_area); + mid_area = llclamp(mid_area, min_area, max_area); + low_area = llclamp(low_area, min_area, max_area); + lowest_area = llclamp(lowest_area, min_area, max_area); + + F32 total_area = high_area + mid_area + low_area + lowest_area; + high_area /= total_area; + mid_area /= total_area; + low_area /= total_area; + lowest_area /= total_area; + + F32 weighted_avg = bytes_high*high_area + + bytes_mid*mid_area + + bytes_low*low_area + + bytes_lowest*lowest_area; - cost *= gSavedSettings.getF32("MeshStreamingCostScaler"); - return cost; + return weighted_avg * gSavedSettings.getF32("MeshStreamingCostScaler"); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f665f39e9c..5d91a0045a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -489,6 +489,42 @@ public: ypos += y_inc; } + //show streaming cost/triangle count of known prims in current region OR selection + { + F32 cost = 0.f; + S32 count = 0; + const char* label = "Region"; + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 0) + { //region + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + for (U32 i = 0; i < gObjectList.getNumObjects(); ++i) + { + LLViewerObject* object = gObjectList.getObject(i); + if (object && + object->getRegion() == region && + object->getVolume()) + { + cost += object->getStreamingCost(); + count += object->getTriangleCount(); + } + } + } + } + else + { + label = "Selection"; + cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectStreamingCost(); + count = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount(); + } + + addText(xpos,ypos, llformat("%s streaming cost: %.1f (%.1f KTris)", + label, cost, count/1000.f)); + ypos += y_inc; + + } + addText(xpos, ypos, llformat("%d MB Vertex Data", LLVertexBuffer::sAllocatedBytes/(1024*1024))); ypos += y_inc; @@ -572,10 +608,6 @@ public: ypos += y_inc; } - addText(xpos, ypos, llformat("Selection Triangle Count: %.3f Ktris ", LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount()/1000.f)); - - ypos += y_inc; - LLVertexBuffer::sBindCount = LLImageGL::sBindCount = LLVertexBuffer::sSetCount = LLImageGL::sUniqueCount = gPipeline.mNumVisibleNodes = LLPipeline::sVisibleLightCount = 0; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 1186d4d8d9..7f373736fa 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3096,7 +3096,7 @@ F32 LLVOVolume::getStreamingCost() return 0.f;
}
-U32 LLVOVolume::getTriangleCount() const
+U32 LLVOVolume::getTriangleCount()
{
U32 count = 0;
LLVolume* volume = getVolume();
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 0c12f14832..b09243055c 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -131,7 +131,7 @@ public: /*virtual*/ const LLMatrix4 getRenderMatrix() const; U32 getRenderCost(std::set<LLUUID> &textures) const; /*virtual*/ F32 getStreamingCost(); - /*virtual*/ U32 getTriangleCount() const; + /*virtual*/ U32 getTriangleCount(); /*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, |