Game Development Community

Particle Sys. Optimizations?

by Stephen Clark · in Torque Game Engine · 08/09/2004 (7:49 pm) · 16 replies

Has anyone done some optimization work on the particle system? I'm using the "Advanced Particle System" resource and there are a few comments in there (from the original code I think) that say "DMMFIX: lame and slow"... wondering if those were parts that should be worked out first...


One does a sort on the particles, is this just for proper alpha?

The other one updates the ObjBox??-why? cant I just set it onAdd?

Any ideas, references to threads or resources would be much appreciated.

thanks,

-s

#1
08/10/2004 (9:09 am)
I've recently rewritten the particle code for the TSE to be much more efficient. The souce is cleaned up and more readable, the linked list of particles is gone, and now all of the emitters draw with a single call. The emitters are using an index buffer too, so it's more friendly to the vertex cache. In a later milestone (couldn't quite get to it last week), the particles will run through shaders so the rotation and billboarding will be done in a vertex shader.

So, yes ;)
#2
08/10/2004 (9:11 am)
Brian: Sweet! Finally, a GPU-based particle system. I hope it still has software fallbacks, though. :)
#3
08/10/2004 (11:15 am)
But can most of that be backported to TGE easily :)
#4
08/10/2004 (10:41 pm)
Oooh cool... how is TSE coming along anyways? TGE owners dont have access to the TSE forum which I feel is bunk!

I think the single call would help my speed issues tremendously. Any chance of that code being stuck in some branch/file?

Thanks,

-s
#5
08/11/2004 (7:39 pm)
Most of Brian's optimizations are built around TSE's new graphic's layer. Functionally the particle system works the same way.
#6
08/11/2004 (8:23 pm)
Anyone there have tips on how to optimize the current stuff?

thanks,

-s
#7
08/15/2004 (9:31 am)
Are the TSE particle emitters going to beable to have multiple particles? I hate it when I want fire that transitions into smoke, but can't get it in one particle.
#8
08/15/2004 (11:46 am)
@Stephen - look at what Brian did, maybe? :)

@Josh - Same functionality, different rendering code. If you need it you could always add it. :)
#9
08/15/2004 (11:53 am)
My wildest dreams are to see Melv's particle work in T2D show up eventually in TSE in one form or another. The possibilities combining the flexibility it offers plus shader-enabled particle surfaces are staggering. :)
#10
08/15/2004 (3:49 pm)
I don't think I could add that w/o alot of work.
#11
08/15/2004 (5:55 pm)
I would love to get my hands on Brian's new PE code, but alas, its in TSE not TGE correct? I would be willing to see if I could get it to work w/ TGE though.

Is Melv's code pretty good too? I could take a stab at integrating that otherwise if it would be prudent.

-s
#12
08/15/2004 (6:27 pm)
Melv's stuff isn't released yet (his latest stuff is in his 2D project) but the feature set is awesome.

In a recent plan I asked if it'd ever see TGE/TSE and he replied that he'd ultimately like to roll it back into his existing TGE particle project, but I'd suspect (read: complete guess) that'd be quite a bit down the road before that'd happen, with the impending baby and all.
#13
08/15/2004 (7:00 pm)
Ah, ok.. I havent been keeping up with the T2D stuff. Thanks!

-s
#14
08/16/2004 (5:14 am)
Did you fix the culling on particles? Theres this problem where if you have a huge explosion or emitter, all the particles dissappear when the center of the explosion leaves the view. I'd like to see culling done per-particle or maybe just a variable that defines the culling size.
#15
08/16/2004 (2:14 pm)
I belive that Melv's PE is for his 3d game, Stratagem.
#16
08/16/2004 (2:32 pm)
Yeah, I havent fixed that as its not an issue for what I'm doing, and I would think the call to update the mObjBox would do it, but perhaps not? I would rather calc the objbox based on the emitter data at the beginning, and it might not be totally accurate, but I could pad it or calc something based on offsets and velocity maybe?

-s