Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Particle Viewing Distance

Isablan Neva
Mystic
Join date: 27 Nov 2004
Posts: 2,907
03-10-2009 13:49
The previous thread just reminded me to ask this...


What are the parameters the govern viewing distance of particle effects? I've been playing around with some particle flames for candles and notice that I can no longer see the effect at 8m away from the candles.:( This seems odd because I've seen other effects like smoke and poofers that were viewable from much farther away.

???
_____________________

http://slurl.com/secondlife/TheBotanicalGardens/207/30/420/
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
03-10-2009 14:12
It depends on the size and possibly the number of particles, and the amount of screen potentially covered by the particle spread.

The actual algorithm has changed several times, accompanied by significant Forum drama. This appears to be the current code:

CODE
		
// find the greatest length that the shortest side of a system
// particle is expected to have
F32 max_short_side =
llmax(
llmax(llmin(mPartSysData.mPartData.mStartScale[0],
mPartSysData.mPartData.mStartScale[1]),
llmin(mPartSysData.mPartData.mEndScale[0],
mPartSysData.mPartData.mEndScale[1])),
llmin((mPartSysData.mPartData.mStartScale[0]
+ mPartSysData.mPartData.mEndScale[0])/2,
(mPartSysData.mPartData.mStartScale[1]
+ mPartSysData.mPartData.mEndScale[1])/2));

F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio();

// Maximum distance at which spawned particles will be viewable
F32 max_dist = max_short_side * pixel_meter_ratio;

if (max_dist < 0.25f)
{
// < 1 pixel wide at a distance of >=25cm. Particles
// this tiny are useless and mostly spawned by buggy
// sources
mLastPartTime = mLastUpdateTime;
break;
}

// Distance from camera
F32 dist = (mPosAgent - LLViewerCamera::getInstance()->getOrigin()).magVec();

// Particle size vs distance vs maxage throttling

F32 limited_rate=0.f;
if (dist - max_dist > 0.f)
{
if((dist - max_dist) * ref_rate_travelspeed > mPartSysData.mPartData.mMaxAge - 0.2f )
{
// You need to travel faster than 1 divided by reference rate m/s directly towards these particles to see them at least 0.2s
mLastPartTime = mLastUpdateTime;
break;
}
limited_rate = ((dist - max_dist) * ref_rate_travelspeed) / mPartSysData.mPartData.mMaxAge;
}
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
BarbaraEllen Galsworthy
Registered User
Join date: 10 Nov 2005
Posts: 45
03-17-2009 08:50
Also, I have found that when the particle prim, including the script of course, is linked to a larger or closer center of linked prims the particles are more visible from the same camera distance. I have noticed this with several home builds I have done in regards to the smoke for the chimneys. If I link the smoke prim to the linked parts of the house build the particles seem to show better from the same camera distance when they wouldn't show before linking.

good luck, Barb HUGS