Some pictures of tests with a GeForce 9800GTS:
About 2400 events spawned via a building's death script + several hundred for the flaming bits. Framerate cost is about 10%, but most of that cost is actually the Piece projectiles hitting the CPU. It peaks at 15% when the smoke expands fast enough to create some depthtest hit, which makes it about 500% faster than the old CEGs were.
About 1200 events spawned as cyclic rocket trails, 5 per projectile per gameframe. Note the spacing: it is accurate between updates and doesn't require any artificial acceleration of the particles, etc., and can be adjusted for more / fewer particles with one math step. No significant framerate cost at all, it's neither bound by CPU nor GPU for these sorts of shorter events with low amounts of depthtest.
What It Is
P.O.P.S. stands for "Powerful Open-source Particle System". It is a 100% free-as-in-beer, GPL'd particle system implementation, written with Lua and GLSL and tested for proper operation on nVidia and ATi hardware. It may even run on higher-end Intel chipsets that meet the base GLSL specification, although I doubt it, simply because Intel's drivers are so terrible. It should fail gracefully on hardware that does not meet specifications.
P.O.P.S. is a project I have been working on in between other things for many months now, specifically to give us a significantly faster general-purpose particle system. It is significantly faster than CEG event calls to CSimpleParticleSystem (the most commonly-used CEG event type) and, because it is coded with Lua, can be used for a very wide variety of tasks.
Why am I releasing it now?
Long story short, because enough basic functionality is done and it works well enough that I think people should take a look at it and start trying to learn how to use it,, and I think it's better to release it now while each example's fairly short than when each one is even more thousands of lines of code.
I don't think that the core code for POPS2_Smoke or POPS2_Fire are going to change between now and the release of P.U.R.E., and other than new refinements, new FX code, etc., the other sections are basically feature-complete and bug-free atm.
What It's Good For
P.O.P.S. is extremely powerful, in the traditional sense. It can be used to replace any standard CEG event with behaviors that are very similar to CEG's, and it can also be used for many things that are either difficult or impossible to do with CEG.
Examples of typical uses include:
Smoke, fire, dust, clouds, sparks, dirt, flying debris, explosions, weapon trails, weather-like effects... pretty much anything where we want to throw significant numbers of particles around in a scene, or create large numbers of particles per gameframe.
I have been developing different uses for P.O.P.S., such as complex building explosions, automated scalable Unit explosions, smoke effects upon damage, particle trails behind projectiles (this includes missiles with really nice smoke trails, no spaces between gameframes, and a very sexy flamethrower). These examples can be seen in the source-code project I am distributing this evening. I am still barely scratching the surface of what P.O.P.S. can do, though, and I am very excited about its potential to significantly speed up battle scenes.
Now, all that said, here are a few things people should understand, before you download it and start playing with it:
1. Are there things it can't do? Yes. It can't rotate particles, because I don't know how to do that with GLSL yet. If you have an effect where you're counting on that, use CEG, I probably won't have time to change that feature before I release P.U.R.E..
2. Will it play nicely with CEG? Absolutely.
3. Will it play nicely with custom UIs and other Lua OpenGL stuff? It should do so in practically all cases, most certainly including LUPS effects (in fact, it makes a great partner with LUPS for a lot of things).
4. Do I plan to write a detailed manual, or to make it very accessible to programming newbies, or build a UI for developing effects or give away magic ponies? Not at this time.
5. Will I answer intelligent questions about use-case stuff? Yes.
6. I tested the old version. What's new since that last tech demo? The short answer is, "a lot", but basically what happened is that I made a real breakthrough in terms of per-event speeds, and it's not only very flexible, but now it's very, very fast per event. There is one last optimization I could make, but atm it's more important (for me) to get it into production than to shave another small bit of performance.
Where To Get It
There is a link attached to this post.
Download it, stick the bitmaps into bitmaps/pops, the code into LuaRules/Gadgets, and you are done with installation.
Past that, you will need to figure out what code you want to modify and build test scenarios.
For a quick, easy test, take a tank or another moving vehicle and write this code into the script (I apologize that this is BOS, not Lua, but I am not yet using Lua):
Code: Select all
static-var isMoving;
lua_CallPOPS(arg) { return (0); }
EmitDust()
{
var random;
random = RAND(45,90);
While(TRUE)
{
if(isMoving == 1)
{
call-script lua_CallPOPS(dust1,2,75); //NOTE: "dust1" is a valid Piece name, use a valid Piece name here.
call-script lua_CallPOPS(dust2,2,75);
sleep random;
} else
{
sleep random * 5;
}
}
}
Create()
{
start-script EmitDust();
}
StartMoving()
{
isMoving = TRUE;
}
StopMoving()
{
isMoving = FALSE;
}
The following is a list of the files that are in the package attached to this post, and what they do (the short version):
POPS2_Fire, POPS2_Smoke: Core P.O.P.S. code. Very well-commented, not fun code to read. If you don't understand the basic ideas behind FBO'd textures being used like a Turing tape in a GPU-driven physics simulation, you probably want to stay the hell away from it.
POPSExplosion: Simple demonstration of CEG replacement. Nothing very complex here, I am so busy working on other things that I haven't had time to give you a new nuke sim yet, etc.

POPSCall: Simple demonstration of how to call P.O.P.S. via COB or Lua unit animation scripts. Currently being used for a very basic generic explosion system for generating explosions from Piece locations, and the trail / dust-cloud effects for moving units.
Yes, you can certainly generate P.O.P.S. events that follow a Piece's dir- substitute the dir for the velX,Y,Z, adjust a particle system pre-built for an appropriate cone angle, voila, it will emit in the direction the Piece faces. I just don't have an example in here atm, but the calls to get the dir are already in that code and ready to use for stuff like "nano effects", "jet exhaust", etc., etc., etc.
POPSProjectileTrailEffects: This is the least newbie-friendly section in most ways. It contains complex behaviors for generating various types of particle trails and LUPS projectile trails. The easiest way to play with this is to set a weapon's customParams up with trail_type=0 and trail='yes' to see a projectile trail that doesn't require LUPS. Past that, you need to read the source and modify it to suit your needs- the math's very straightforward but it isn't trivial.
POPSBuildingDeath: This is that skyscraper's death animation atm, nothing more, nothing less. You can't really see this without the latest World Builder, and it's probably not a very good place to start poking at P.O.P.S. but I included it for completeness's sake.
That's all, good luck and have fun
