All right. Particles!
This tale starts last summer, when I, like many, thought I'd like to render a lot of particles.
Like many, my first idea was to instance a bunch of particles to each simulated particle.
This, not surprisingly. led to something resembling a lot of fuzzy cotton balls.
Thinking of how to break up the cottonballsiness, I ended up creating a looping 1000-frame
bgeo sequence of twenty or so particles gyrating around the origin. (cos is your friend..:)
This sequence was then instanced to each particle, with pseudorandom rotation. Also, the
particles had 30 different time offsets for the loop.
Still the cotton balls were there. (couldn't find frames from this phase)
In retrospect I probably should have spent more time tweaking this instancing approach,
as it seems to have worked for many in actual production.
I started thinking about ways to create new particles between the existing ones, and do it
procedurally without simulation, so that a random frame can be calculated. Every scheme I came
up with was lacking, usually it wouldn't have been temporally coherent. So I dropped the
requirement of not needing to know the previous frame.
Simulation it will be, then. Also by this time I thought I'd up the ante. I would learn cuda, write
the simulation bit myself, and render a BILLION particles. Good luck.
It wasn't too bad. The method I ended up with was simple; the new particles get their velocity
from nearby particles and move according to that. Think of it as the old particles being some
sort of attractors, or just as v attribute transfer. Just transferring P would've been "safer", but
the result would be more boring. With v there would be some new emergent behaviour.
Transferring force/acceleration would be even more exciting, but more risky too.
This is one of the first successful outputs, looking promising.
The red balls are the input seed particles. And then the first renders - now I knew the approach
really worked.
different alphas
To be able to go as high as possible I kept the data per particle as small as possible, and
at this point I also converted the cuda code to work in buckets and also to 64 bits. Getting
the buckets to work resulted in
some wild results on the
way..
Now, armed with a more linear algorithm, I started cranking up the point count.
With this version I made my way up to 115 million, and this render is probably the best I've come up
with, yet.

I love how it has some nice new detail that does not exist in the seed sim.
So, at this point my executable read a .geo sequence with 1 million points in it, did it's resim magic
and spit out a .geo with 115 million particles, which I would then render out in Mantra. The resim here
took perhaps 15-20 mins per frame on a G260, and writing the resulting 4.5gig ascii geo (uggh!) took
20 minutes :D
Mantra mem usage here was getting close to 10 gigs (the machine has 12) so I knew I had to
change the angle to get higher. Still one order of magnitude to go after all!
I was hoping that mantra would throw stuff out of memory when no longer needed. (no raytrace)
If I wrote the pointcloud out in buckets, it might be a lot easier for Mantra, memwise.
That I did, and also finally rewrote the load/save to use the binary format. Save times dropped 10x :)
After having a discussion with Hoknamahn on the subject (thanks dude), I understood that
converting stuff to i3d for rendering might be an option too.
Enter the current beast. Now it reads a 10 million particle seed sim .bgeo sequence and spits out:
a) ~ 7k .bgeo buckets with 400 million particles total, b) an ifd fragment that loads in the above
buckets as dla's, c) a script that converts all the pointcloud buckets into i3d's via i3dgen.exe,
d) the resulting 7k i3d's, and e) a similar ifd fragment for the volumes. Phew. Ugly.
Currently my code needs all the particles to be in cpu memory, so 400mil is about the highest
I can get to with 12 gigs.
When loaded into Mantra, the ifd fragment then assembles these volumes into a ~30^3 cube
(empty buckets are not saved) with correct bounding boxes. The combined resolution of the i3d's
is ~1800^3. So far so good, but now I hit a bit of a wall. My assumption about mantra throwing
out no-longer-needed dla's seems to be wrong, or at least I haven't been able to coax it into
doing that. So I haven't been able to really render this 400 million dataset yet, only without
shadows it reaches the end. *sniffle*
Ideas, anyone?
I haven't tested with the particle buckets yet, here's to hoping..
My idea-bag isn't completely empty yet, though :)
Doing this in passes/layers would of course be easier but I want to do it all at once..
Chasing after big numbers and "rendering a billion particles" might sound like a childish goal,
especially as I have no production need for it, but I've learned a LOT during this - and will likely
learn still more until there ;)
Particle diary will continue.. higher peaks are still waiting
eetu.