From 44308a6693d1c79433db1dcad25f9846601f1c6c Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 7 Feb 2011 20:12:42 -0500 Subject: SH-923 FIX particle render cost does not appear to be functioning properly was checking the age of the particle system, not the individual particles. This appears to fix the problem. Deferring QA on the new algorithm until it is completed. --- indra/newview/llvovolume.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a388d2ef30..c65b888bf9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2943,7 +2943,8 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const U32 num_triangles = 0; // per-prim costs - static const U32 ARC_PARTICLE_COST = 100; + static const U32 ARC_PARTICLE_COST = 1; + static const U32 ARC_PARTICLE_MAX = 2048; static const U32 ARC_TEXTURE_COST = 5; // per-prim multipliers @@ -3173,7 +3174,15 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const // add additional costs - shame += particles * ARC_PARTICLE_COST; + if (particles) + { + const LLPartSysData *part_sys_data = &(mPartSourcep->mPartSysData); + const LLPartData *part_data = &(part_sys_data->mPartData); + U32 num_particles = (U32)(part_sys_data->mBurstPartCount * llceil( part_data->mMaxAge / part_sys_data->mBurstRate)); + num_particles = num_particles > ARC_PARTICLE_MAX ? ARC_PARTICLE_MAX : num_particles; + F32 part_size = (llmax(part_data->mStartScale[0], part_data->mEndScale[0]) + llmax(part_data->mStartScale[1], part_data->mEndScale[1])) / 2.f; + shame += num_particles * part_size * ARC_PARTICLE_COST; + } return (U32)shame; } -- cgit v1.2.3