SL-897 - added animated object streaming cost to DebugAnimatedObjects display.

meow-7.2.2
Brad Payne (Vir Linden) 2018-03-27 19:27:05 +01:00
parent a3fd0801c3
commit af30a35dc2
2 changed files with 24 additions and 4 deletions

View File

@ -244,6 +244,7 @@ void LLControlAvatar::updateDebugText()
S32 total_verts = 0;
F32 est_tris = 0.f;
F32 est_streaming_tris = 0.f;
F32 streaming_cost = 0.f;
for (std::vector<LLVOVolume*>::iterator it = volumes.begin();
it != volumes.end(); ++it)
@ -254,6 +255,7 @@ void LLControlAvatar::updateDebugText()
total_verts += verts;
est_tris += volp->getEstTrianglesMax();
est_streaming_tris += volp->getEstTrianglesStreamingCost();
streaming_cost += volp->getStreamingCost();
lod_string += llformat("%d",volp->getLOD());
if (volp && volp->mDrawable)
{
@ -287,8 +289,9 @@ void LLControlAvatar::updateDebugText()
type_string += "-";
}
}
addDebugText(llformat("CAV obj %d anim %d active %s impost %d",
total_linkset_count, animated_volume_count, active_string.c_str(), (S32) isImpostor()));
addDebugText(llformat("CAV obj %d anim %d active %s impost %d strcst %f",
total_linkset_count, animated_volume_count,
active_string.c_str(), (S32) isImpostor(), streaming_cost));
addDebugText(llformat("types %s lods %s", type_string.c_str(), lod_string.c_str()));
addDebugText(llformat("tris %d (est %.1f, streaming %.1f), verts %d", total_tris, est_tris, est_streaming_tris, total_verts));
addDebugText(llformat("pxarea %s", LLStringOps::getReadableNumber(getPixelArea()).c_str()));

View File

@ -3918,9 +3918,26 @@ F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_v
{
F32 radius = getScale().length()*0.5f;
// AXON make sure this is consistent with the final simulator-side values.
const F32 ANIMATED_OBJECT_BASE_COST = 10.0f; // placeholder
const F32 ANIMATED_OBJECT_COST_PER_KTRI = 1.0f; //placeholder
F32 linkset_base_cost = 0.f;
if (isAnimatedObject() && isRootEdit())
{
// Root object of an animated object has this to account for skeleton overhead.
linkset_base_cost = ANIMATED_OBJECT_BASE_COST;
}
if (isMesh())
{
return gMeshRepo.getStreamingCost(getVolume()->getParams().getSculptID(), radius, bytes, visible_bytes, mLOD, unscaled_value);
if (isAnimatedObject() && isRiggedMesh())
{
return linkset_base_cost + ANIMATED_OBJECT_COST_PER_KTRI * 0.001 * getEstTrianglesStreamingCost();
}
else
{
return linkset_base_cost + gMeshRepo.getStreamingCost(getVolume()->getParams().getSculptID(), radius, bytes, visible_bytes, mLOD, unscaled_value);
}
}
else
{
@ -3934,7 +3951,7 @@ F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_v
header["medium_lod"]["size"] = counts[2] * 10;
header["high_lod"]["size"] = counts[3] * 10;
return LLMeshRepository::getStreamingCost(header, radius, NULL, NULL, -1, unscaled_value);
return linkset_base_cost + LLMeshRepository::getStreamingCost(header, radius, NULL, NULL, -1, unscaled_value);
}
}