Particle system control/movement

Started by
6 comments, last by teamonkey 19 years, 7 months ago
I'm tired of the same old equations to push my particles around, I need some variety. [grin] My current particle system works quite nicely and so far I've been generating different effects with different emitters (which spew out particles in various shapes with various colours). However after that they all just use a simple controller which is just your basic velocity & gravity movement. Anyone any ideas for more interesting methods to control the movement after creation? I'm not really going for realism here, just some extra eye candy.
Advertisement
If you think about it, everything in the "real" world is driven by the kinematics laws (okay, so maybe not entirely...but we can "assume")...so any effects you are looking for can be done the way you are doing them.

But what I want to know is what kind of effects are you looking for? A cool snow storm effect is pretty different than an explosion effect, or a whispy smoke effect.

I'm not really after realistic effects, as you say most of them end up using pretty standard movement equations. I'm kinda at a loss for idea, hence the post. At the moment I'm thinking more about effects with particles strung together (lightning perhaps, or forcefields).
You need a specific gravity per emitter, rather than use regular gravity. The reason is that things like exhaust is warm, and rises, rather than falls.

You should probably have a dampening factor for velocity, so that you negate current velocity by a FACTOR * curVelocity.

I find it useful to support (camera-aligned) spin of particles; possibly with different spin speeds/directions per particle.

Most higher-end particle systems support some form of collision with reality, although it might be as simple as casting one ray when you spawn the particle, and remembering an "infinite plane" aligned to whatever that ray hit.

To shape the flow of particles, many systems support attractors and repulsors. These are points in space that have gravity or anti-gravity on particles, proportional to distance, or distance squared (d-squared is cheaper, AND more physically accurate, but may make your artists unhappy).

Note that half of the benefit in a particle system comes from using good textures, and good blending modes (i e, ONE, ONE_MINUS_SRC_ALPHA is useful, as is ZERO, SRC_COLOR and SRC_ALPHA, ONE_MINUS_SRC_ALPHA, and the classic additive: ONE, ONE). As an example: A diffuse blob in the middle is NOT a "good texture". A diffuse blob of alpha in the middle overlaid by gaussian noise that's blurred with a radius of about 2 pixels makes for a better texture (for cloud-like effects).
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
You need a specific gravity per emitter, rather than use regular gravity. The reason is that things like exhaust is warm, and rises, rather than falls.

Gravity is definatly a controller thing, not emitter. And yes, at the moment I can plug in different controllers and configure them with different gravity strengths. I could add damping here as well, but thats still firmly in the regular movement area. :(

Per-particle spin and attractors sounds like a good idea though. Are there any particular uses of attractors/repulsers that you're thinking about?
Air friction looks great with certain things.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
In general, partical systems are divided into state preserving and state less particle systems.
State less particle systems are the most used on today's widespread hardware (hardware that does not support Vertex shader 3). These particle systems the particle's position is just a function of time, and each frame you don't care for the particle's previous velocity or state.This is the particle system used to make most of the particle effects in today's games (exposions, fire, water falls).
If you are trying to make a more advanced particle effect, then first define why do you use it, as it is not easy to implement and its impact on the performance will not be small.
For making a state preserving particle system, you should be storing the state (position,velocity and forces ) affecting each particle each frame, because these variables will affect the particle in the next frame.
This storage will be in textrues, so you will have a texture for velocity, a texture for accelatation and a texture for position, and of course the size of these texture depends on the number or particles in your system as each pixel will be used for one particle.you can decrease the number of textrues by using verlet integration to get rid of the velocity texture.
Vertex shader 3 is needed, to read the accelaration and position of the particles in the previous frame from the textures.This is a limitation on PC hardware.
for more details see the "Building a Million particle system" article on gamasutra.
A fun thing might be to get the particles to attract to one another rather than a central attractor. They'll sort of gloop together into clumps. Maybe they could stick and form a bigger particle; maybe they could stick to walls?
[teamonkey] [blog] [tinyminions]

This topic is closed to new replies.

Advertisement