[sldev] Questions on the particle system
Dale Glass
dale at daleglass.net
Sun Dec 2 12:59:17 PST 2007
I started messing with particles a bit, after getting rather frustrated
when trying to take screenshots with particle effects.
I modified LLViewerPartSim::updateSimulation() to sort particle sources by
distance. This for some reason didn't do what I expected (rendering nearby
sources and not far away ones), but at least it got rid of the sputtering.
The exact problem is: Sorting works alright. If I sort then only render the
first 5, I see only the nearest 5 work. But the particle limit seems to be
equally spread among all active effects.
I also added two new settings: RenderMaxPartSourcesCount and
RenderMaxPartDistance. The first one is mostly for testing, the second is
the maximum distance a source can be from the camera for the effect to be
made. This is intended in part as an anti-griefing measure: with this it's
possible to silence those huge particle effects while keeping the nearby
ones.
Now questions.
What is LLViewerPartGroup and what is done at the end of
LLViewerPartSim::updateSimulation()?
Why does the particle limit work by keeping a counter that gets incremented
in constructors and decremented in destructors instead of just setting it
to 0 on each start of frame and counting what's actually getting rendered?
Why do invisible effects still count towards the particle limit?
Here's what I'm intending to achieve, unless there's some reason why this
is undesirable:
* Particle sources are sorted by distance (done)
* No sputtering, particle effects when running into the limit reduce the
count smoothly. (done)
* Nearest sources have priority. If you zoom on something, it's pretty much
guaranteed to take most or all of the particle quota.
* If particles aren't being emitted, then it doesn't count towards the
limit
* When the particle limit approaches, effects are throttled gradually (so
particles don't instantly vanish at some cutoff point unless you use the
distance limit)
How does this sound?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20071202/9e11ee2b/attachment.pgp
More information about the SLDev
mailing list