diff options
author | Dave Parks <davep@lindenlab.com> | 2011-06-02 22:58:57 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-06-02 22:58:57 -0500 |
commit | de5f93ca52f207380baca6895b499cb7fcffead8 (patch) | |
tree | 1a9fb3dd33edafb08ca3691dd1af3125add135c8 /indra/newview/llvovolume.cpp | |
parent | faef58a9b91ecbbffd93fa90347f1b8bd5856902 (diff) |
SH-1732 Add streaming cost calculation for mesh objects.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c917a5fd9d..39e555f781 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3096,16 +3096,28 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes) { + F32 radius = getScale().length(); + if (isMesh()) { LLSD& header = gMeshRepo.getMeshHeader(getVolume()->getParams().getSculptID()); - F32 radius = getScale().length(); - return LLMeshRepository::getStreamingCost(header, radius, bytes, visible_bytes, mLOD); } - - return 0.f; + else + { + LLVolume* volume = getVolume(); + S32 counts[4]; + LLVolume::getLoDTriangleCounts(volume->getParams(), counts); + + LLSD header; + header["lowest_lod"]["size"] = counts[0] * 10; + header["low_lod"]["size"] = counts[1] * 10; + header["medium_lod"]["size"] = counts[2] * 10; + header["high_lod"]["size"] = counts[3] * 10; + + return LLMeshRepository::getStreamingCost(header, radius); + } } U32 LLVOVolume::getTriangleCount() |