From de5f93ca52f207380baca6895b499cb7fcffead8 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 2 Jun 2011 22:58:57 -0500 Subject: SH-1732 Add streaming cost calculation for mesh objects. --- indra/newview/llvovolume.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvovolume.cpp') 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 &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() -- cgit v1.2.3