Age | Commit message (Collapse) | Author |
|
More of 86bc322, eliminate per-particle unnecessary calls
|
|
This is a trivial optimization which makes a substantial difference.
When we're doing things like explosions, thousands of occupants get
added to the bsp tree at the exact same position. Without the lookup
cache we end up traversing the octree down to its maximum depthrepeatedly,
because the bv containing the explosion is of course full and maximally
deep.
Now explosions don't need to spend a bunch of time in the octree just to
keep locating the same full bv the explosion occurs in.
|
|
|
|
trivial per-particle savings
|
|
|
|
Multiplies tend to be less costly
|
|
Stride needs to be considered as part of width, this is wrong,
funnily none of my test systems exposed it.
|
|
A while ago I made this particle system on SDL, and had the beginnings of
an octree implemented within it, but never finished actually using the
octree to accelerate the proximity searches.
This now has the octree completed and of course more particle interactions now
that neighbors could be found more quickly.
The simulation somewhat resembles a fireworks display. Every particle is drawn
as a single pixel. The visual effect is dominated by spontaneously spawned
rockets which explode into thousands of particles accompanied by bursts that
thrust particles away from the explosion radially in an expanding sphere
resembling a shock wave. When the shock wave happens to strike another rocket,
it explodes, resulting in another shock wave. This can produce spectacular
chain reactions, so it's worth running for some time and seeing what transpires.
|