diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-02-07 20:12:42 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-02-07 20:12:42 -0500 |
commit | 44308a6693d1c79433db1dcad25f9846601f1c6c (patch) | |
tree | 29762ed75d347c8d9695462616958c6b0c175517 /indra/newview | |
parent | 9f361b47ffaf884f996b213d90fb57f535514744 (diff) |
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.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llvovolume.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
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;
}
|