Particle System Improvements

Threads related to Google Summer of Code
Post Reply
Tenttu
Halfling
Posts: 74
Joined: Mon Dec 13, 2004 1:56 pm

Particle System Improvements

Post by Tenttu »

More information:
http://www.students.tut.fi/~valkone8/SoC2007.pdf

General
Ogre has had for a long time a feature rich particle system implementation. However the newest advancements in hardware development and implementations of totally new kinds of options for graphic development has left holes to the old and stable particle system. There are multiple improvements that can be done for the system and I represent these more closely below.

Project Details
GPU Particles
Particle systems, especially on GPU, are divided into 2 different categories, stateless and state-preserving particle systems. Stateless implementation simply just updates the vertex positions of the particles, generating simple, but very fast particle systems.
The idea behind state-preserving systems is to store information about the state of the particle system. Information that is usually stored is position, velocity and some other data, like time of live etc. Hardware requirements for these kind of systems are floating point buffers and vertex texture support. Even complex effects can be handled with this system for example collisions, but collision against polygon soup is not efficient on GPU, which means that collision can't really be used on real-life production, only on some small demonstrations.

In this section goals for the SoC in order are:
- Implementing simple stateless particle system
- Benchmarking stateless particles against traditional system
- Implementing state-preserving systems, with most important features of the current system like fade out etc. Still keeping the implementation simple. This requires SM 3.0 hardware.
- Benchmarking state-preserving system against stateless particle system and traditional implementation.
- Demo that shows the advantages of GPU particles.

Multithreaded Particles
Multithreaded particles are the newest field of particle systems following the release of multi core CPUs. The basic idea behind multithreaded particle system is to update the movement and other changing parameters equally on each core of CPU. This can dramatically improve the speed and makes it possible to create more complex particle effects.

In this section goals for the SoC in order are:
- Implementing multithreading into current particle system.
- Benchmarking multithreaded system against traditional one.

Improvements to Particle script
Additions to particle scripting would have to be made to support the new implemented features.

billboard_type script value would be extended with settings vertex_shader and geometry_shader. These would activate the GPU based particle systems.

Also a setting mesh would be useful to use meshes as particles, syntax could be following:
billboard_type mesh gravel.mesh

Ability to store multiple particle systems into one â€
Last edited by Tenttu on Tue Mar 20, 2007 10:49 pm, edited 2 times in total.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Just to point out spookyboo's work and plans with FX_plugin.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Spookyboo looks like the perfect mentor for this project :)

I'm intrigued about the particle pooling. Ogre already supports this. What plans do you have about it?
Image
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

Yes.. spookyboo is the first name comes to my mind upon seeing this thread :) The idea is nice, but should be made so that Spookyboo's code and the code from SOC are not redundant. Spookyboo is obviously the best mentor for this, but I am not sure whether the mentor application is still available. Plus it is his prerogative - time and commitment are needed here.
Tenttu
Halfling
Posts: 74
Joined: Mon Dec 13, 2004 1:56 pm

Post by Tenttu »

I'm intrigued about the particle pooling. Ogre already supports this. What plans do you have about it?
I meant a system that also pools particle systems, when needed. Mainly refering to the help request
"Threadsafe small object allocators and pool management. Defined memory regions with budgets and pool settings."
This is after all what you need to do if you want to seriously use particle systems, but might be a bit out of Ogre's scope though? As it might be more beneficial to pool the higher level objects using particle systems.
User avatar
spookyboo
Silver Sponsor
Silver Sponsor
Posts: 1141
Joined: Tue Jul 06, 2004 5:57 am
x 151
Contact:

Post by spookyboo »

Tenttu, great idea to improve Ogre's particle system. That is also the reason why I'm creating a new particle system from scratch. My particle system is meant to be an addition to the current particle system and not a replacement.

syedhs is right about redundant activities. A number of things you have listed are also the things I want to investigate and integrate in my plugin, although my progress is a bit slow. I can't even think about mentoring, because I have very little time :cry:, but I'm willing to help as much as I can.

Some thoughts:
- Multi-threading is number one on the list of needed features imo.
- Something to investigate is the ability to create new emitters and affectors more dynamically (by means of a script). Often the code is very simple, but you have to create several new files for it and add some code here and there.
- Interaction of particles with the environment is very needed. I'm working on it also, but I think my first release will be a low-profile implementation.
- About new affectors: Flocking and fluid (like) simulations would be interesting
- Regarding the new script parsing system: I'm using it, but its important to think about its usage carefully. The way it is used in the Material- and Compositor- compiler doesn't really fit in the case of the Particle System, because of its extensibilty. I have struggled with it for some time and the solution I use still doesn't feel completely right.

Thanks for the links btw. :lol:
Tenttu
Halfling
Posts: 74
Joined: Mon Dec 13, 2004 1:56 pm

Post by Tenttu »

Seems I have missed some of the progress/goals of FXPlugin/ParticleUniverse. I always thought it was just a general effect plugin, using Ogre's systems. Also will the license be compatible with the new additional license (static linking)?
- Multi-threading is number one on the list of needed features imo.
I agree, multithreading would be pretty high on my priority list also. Altough there is also places were GPU particles are useful. Of course they won't give that much control and fancy effects, but are very fast for simple particle effects and especially when geometry shaders are implemented, GPU particles will have their place.
- Something to investigate is the ability to create new emitters and affectors more dynamically (by means of a script). Often the code is very simple, but you have to create several new files for it and add some code here and there.
There is definately things to improve with particle scripting, but it becomes hard if you try to keep it backward compatible.
- Regarding the new script parsing system: I'm using it, but its important to think about its usage carefully.
I have worked with it on some extend, but have to say that I totally agree with you. It's on my list as I assumed it will be changed someday and it would probably be a good idea to tackle it, before any complex addons are made for the system.
syedhs is right about redundant activities. A number of things you have listed are also the things I want to investigate and integrate in my plugin, although my progress is a bit slow.
Of course there is no idea to do things twice as long as the licenses are compatible, but for sure there is enough work to be done. Also most of the improvements I proposed should be imo included with main ogre for easy of use to all users.


[edit]
Spherical billboards would also definately have their place in Ogre. Some engines call them as "Soft Particles" seen in Cryengine2 for example.
http://www.gametrailers.com/umwatcher.php?id=11693
[/edit]
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

Combining the ogre particle system with the particle library from http://www.cs.unc.edu/~davemc/Particle would be very interesting (something I've been planning on doing for ages, but never have the time).
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

My suggestion for advanced particles is to try to bring them more in line with the particle system capabilities in 3D tools like Max.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
Tenttu
Halfling
Posts: 74
Joined: Mon Dec 13, 2004 1:56 pm

Post by Tenttu »

A deeper description about the proposal is now written and changed as the first post. Feedback about the current list would be nice.
My suggestion for advanced particles is to try to bring them more in line with the particle system capabilities in 3D tools like Max.
What exactly does Max support that can't be done with Ogre's particle system?
boros000
Gnoblar
Posts: 1
Joined: Tue Mar 27, 2007 8:04 pm

Shader Programming

Post by boros000 »

I have just one question,

I want first just to multiple to int numbers.How should i start.
futnuh
Goblin
Posts: 225
Joined: Sun Sep 25, 2005 3:22 am
Location: Calgary, Alberta
x 1

Post by futnuh »

xavier wrote:My suggestion for advanced particles is to try to bring them more in line with the particle system capabilities in 3D tools like Max.
Ahem, don't you mean Houdini? :-)

I would strongly urge people interested in extending Ogre's particle system to look at Houdini. Its inherent proceduralism maps very easily to a code implementation.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

I would also like to add that animated billboard particle should be supported. I worked with a few artist who asked for that feature in Ogre.

When I say animated billboards, I mean animated per particle instance. NOT using material hack. That means we can set a particle start frame and end frame where the frame will animate base on it's particle life. Really nice effect for explosion, fire and such. ;-)
Tenttu
Halfling
Posts: 74
Joined: Mon Dec 13, 2004 1:56 pm

Post by Tenttu »

I would strongly urge people interested in extending Ogre's particle system to look at Houdini. Its inherent proceduralism maps very easily to a code implementation.
The particle page at Houdini's site doesn't really describe the system very deeply. Lots of features also seems rather hard to be implemented in real-time system, but the rules based simulation got me interested. Is there anywhere more information/documentation about that?
I would also like to add that animated billboard particle should be supported.
This would be a really good addition. Implementation could be done by moving uv coordinates of the particle triangles according to the animation and storing all the animation frames into one texture.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Post by lf3thn4d »

Tenttu wrote:
I would also like to add that animated billboard particle should be supported.
This would be a really good addition. Implementation could be done by moving uv coordinates of the particle triangles according to the animation and storing all the animation frames into one texture.
Yep. Exactly what I was thinking :-) Infact, Ogre's billboard already support uv grid system to have animation frames in one texture. Hence this feature is already very possible. I once had in mind to extend a subclassed particle renderer to do this. But thanks to ogre's billboard particle not using protected virtual functions, it wasn't possible at all. Guess it's still best to extend ogre directly. :-)
azrialelf
Gremlin
Posts: 155
Joined: Wed Jul 11, 2007 2:43 am
x 7

Re: Particle System Improvements

Post by azrialelf »

When I say animated billboards, I mean animated per particle instance. NOT using material hack. That means we can set a particle start frame and end frame where the frame will animate base on it's particle life. Really nice effect for explosion, fire and such. ;-)
I realize this is a very old thread, but was any sort of feature like this implemented? I could REALLY use it for my game right about now.... Trying to make a cool fire/smoke effect and have a fantastic image sequence to use, but I need each particle to have it's own instance of the material so it looks right.
Post Reply