Jump to content
  • Advertisement
Sign in to follow this  
xegoth

Particle explosions

This topic is 5077 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I added particles to my engine, the only trouble is I have no clue how to direct my particles so they make good looking explosions. Can anyone point me in the direction of a DirectX tutorial that might help me out with that?

Share this post


Link to post
Share on other sites
Advertisement
Does +velocity away from point not look good?

How about +velocity away from point followed by constant small -velocity?

[I've not tried with my own particle system, but that's what I've seen used]

Share this post


Link to post
Share on other sites
The funny thing is:
From my experience what looks best is NOT creating a whole lot of particles and endlessly play with the parameters.

But instead: render 30+ frames of an explosion in 3D studio or whatever (in 3DS there's a fire effect which looks quite nice), use this animation as a texture for your particles, create just a few (like 10 per second) but make the particles really big. Optionally use additive blending.

I'd say that's the way most games do it. Even the movie industry often uses filmed explosions in CG stuff (the fire of the balrog in LOTR1). That's also the method nvidia has chosen for it's balrog like fire demo (and they explain it in great detail in gpu programming gems).

Share this post


Link to post
Share on other sites
The last explosion I did with particles was pretty simple yet looked effective. I started by creating a host of particles of slightly different sizes at a given point. Each particle was given a life around a certain time (some would be longer, some smaller) and a velocity (again, added some randomness). As the particle aged, it shrunk and faded in colour (velocity stayed constant). What happened was a bright centre of particles that dispersed as expected, the fading and shrinking of the particles ensured that only the biggest ones lasted until the end.

You could expand this system by placing a pseudo shockwave effect, essentially a rapidly expanding sphere that travels faster than the explosion itself (and fades) and by adding secondary explosions - and debris. The debris could fly out at a random tragectory and is affected by gravity, it could even cause a mini explosion when it impacts something.

Share this post


Link to post
Share on other sites
Thanks evolutional I'm going to give that a try, what was did the texture of your particles look like though?

Share this post


Link to post
Share on other sites
This is one that I used. It's a TGA with RGBA (eg: Alpha channel).. It's fairly simple, I'll probably experiment with other textures when I have time, but I think the key is to having it rendered with several different scales and getting the colour blend right.

EDIT: For some reason the TGA wouldn't download from my GDNet+ space, so I put a BMP up.

Share this post


Link to post
Share on other sites
@evalutional
it seems like your particle is different than the one i downloaded
here's the one i downloaded: http://www.microsqft.com/files/particle.png
can it be useful for explosions? fire? or its not a good particle?
i didn't made any particle effects (like explosions or fire) yet so i have no idea

thanks,
Amir.

Share this post


Link to post
Share on other sites
If you're doing an explosion, you probably want to have fire and smoke. That means additive blending for the fire and alpha blending for the smoke. If you use pre-multiplied alpha textures you can render both blend modes in one go. Just sort the particles back-to-front and render them all in one batch. You'll probably want two images - one for the fire; one for the smoke. Pack these together into a single texture so they can be rendered in one batch. Also, if you can, use an animation for each one rather than a static image.

As for motion, try firing a few (5?) particles out and have them spawn other particles as they move. Randomise stuff like size, velocity; make them spin, etc.

HTH

Matt

Share this post


Link to post
Share on other sites
My texture is a simple one I jammed together, you can use pretty much any texture you want - it's a good idea to experiment and try things out.

As Matt said, you definitely need Additive blending to get the correct effect, the colours blend together and brighten when several are over one another, giving the effect of a white hot core which dissipates into fire and smoke. I don't use smoke in many of mine, mainly because my stuff is mostly space based (and smoke doesn't seem to be a feature of space explosions). It is good if you give an explosion as a whole an 'energy' value, each time the explosion breaks into particles, split this energy between them and again, if the energy is above a certain threshold, make the particle explode slightly again, breaking up it's energy until it's exhausted. This way, as Matt pointed out, you'll get a nice cascade effect and several smaller explosions.

I think creating effects for games can be really good fun, the best thing you can do is try and implement a particle system you can control/manipulate and then play with the results. When I got my first plasma systems going, I spent literally hours just playing with it :)

Share this post


Link to post
Share on other sites
Okay i think a big thing my explosions are missing is additive blending, heh anyone know how to turn that on? ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!