summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmeshrepository.h')
-rw-r--r--indra/newview/llmeshrepository.h59
1 files changed, 57 insertions, 2 deletions
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 22215c784a..bba0c9f2cb 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -490,6 +490,53 @@ private:
LLCore::HttpRequest::priority_t mHttpPriority;
};
+// Params related to streaming cost, render cost, and scene complexity tracking.
+class LLMeshCostData
+{
+public:
+ LLMeshCostData();
+
+ bool init(const LLSD& header);
+
+ // Size for given LOD
+ S32 getSizeByLOD(S32 lod);
+
+ // Sum of all LOD sizes.
+ S32 getSizeTotal();
+
+ // Estimated triangle counts for the given LOD.
+ F32 getEstTrisByLOD(S32 lod);
+
+ // Estimated triangle counts for the largest LOD. Typically this
+ // is also the "high" LOD, but not necessarily.
+ F32 getEstTrisMax();
+
+ // Triangle count as computed by original streaming cost
+ // formula. Triangles in each LOD are weighted based on how
+ // frequently they will be seen.
+ // This was called "unscaled_value" in the original getStreamingCost() functions.
+ F32 getRadiusWeightedTris(F32 radius);
+
+ // Triangle count used by triangle-based cost formula. Based on
+ // triangles in highest LOD plus potentially partial charges for
+ // lower LODs depending on complexity.
+ F32 getEstTrisForStreamingCost();
+
+ // Streaming cost. This should match the server-side calculation
+ // for the corresponding volume.
+ F32 getRadiusBasedStreamingCost(F32 radius);
+
+ // New streaming cost formula, currently only used for animated objects.
+ F32 getTriangleBasedStreamingCost();
+
+private:
+ // From the "size" field of the mesh header. LOD 0=lowest, 3=highest.
+ std::vector<S32> mSizeByLOD;
+
+ // Estimated triangle counts derived from the LOD sizes. LOD 0=lowest, 3=highest.
+ std::vector<F32> mEstTrisByLOD;
+};
+
class LLMeshRepository
{
public:
@@ -511,8 +558,13 @@ public:
static LLDeadmanTimer sQuiescentTimer; // Time-to-complete-mesh-downloads after significant events
- F32 getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
- static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
+ // Estimated triangle count of the largest LOD
+ F32 getEstTrianglesMax(LLUUID mesh_id);
+ F32 getEstTrianglesStreamingCost(LLUUID mesh_id);
+ F32 getStreamingCostLegacy(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
+ static F32 getStreamingCostLegacy(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
+ bool getCostData(LLUUID mesh_id, LLMeshCostData& data);
+ bool getCostData(LLSD& header, LLMeshCostData& data);
LLMeshRepository();
@@ -623,5 +675,8 @@ public:
extern LLMeshRepository gMeshRepo;
+const F32 ANIMATED_OBJECT_BASE_COST = 15.0f;
+const F32 ANIMATED_OBJECT_COST_PER_KTRI = 1.5f;
+
#endif