Sign in to follow this  

Particle effects.

This topic is 4843 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

Hi, I have create an cave for my 3D game and I want to add some torch on the walls, I have loaded the models for the torchs and now I whant to add some particle effets to them, like fire. If anyone knows about tutorials or can write me an example on how to create 3d fire that looks nice and can be useful to the torchs I will be glad, hope you guys have some time. thx.

Share this post


Link to post
Share on other sites
'Looks nice' is pretty much your own guess-and-check, but there are tons of articles on the net about particle systems. I remember one at DevMaster.Net, there are many at GameDev.Net, and there was a link to one (first one written, I think) from some magazine that I forget, but it should be in one of the GameDev links.

Hope it helps, and happy coding!

Share this post


Link to post
Share on other sites
A game team I was in last year used a system out of one of the Game Programming Gems books (Gems 3 IIRC, but I could be wrong.) We had to speed it up by changing how memory was allocated, but it worked great after that. We had fire, weather and magic effects as well as using it in the items menu and start screens as a cursor.

Share this post


Link to post
Share on other sites
Fire is pretty simple. Setup up your particles as billboards (of course), and construct a particle emitter that will release particles from a point and give them an upward velocity. You can randomize the paths of the upward-moving particles a bit to diffuse the flame pattern a bit. Randomize the lifetime of the particles to keep the flame ragged, and tweak the average lifetimes to keep the flame compact and concentrated. Use a particle texture that blends out softly from the center to the edges, and use additive blending so that particles layered on each other consecutively increase the overall color. Specify values of color for the particles such that as they are added together the color will increase from red through orange to yellow and white, and perhaps have them slowly change in color over their lifetime, dimming toward red as they 'die'. The particles used in the fire effect shown here:


use colors that blend from (R=0.7, G=0.7, B=0.2) to (R=0.2, G=0.0, B=0.0) over the lifetime of the particle.

There are a lot of ways you can tweak the particle system. For a torch, you could use smaller-sized particles with shorter average lifespans. With such a small flame, you would only need a relative handful of particles; the bigger the flame, the more particles you need. If you are curious as to how a general purpose particle system might be designed, you might take a look at the particle effects usable in the 3D modeller Blender. Take note of what options are customizable and what data can be specified, and think about how you might implement a similar system in your own game.

Share this post


Link to post
Share on other sites
Hi,
MMMM cubes... depending what you are looking for.

You have two types of particle systems. Basic particle systems are formed of points. Each point is transformed using a specific movement function and the resulting point is used to render a billboard sprite (billboard sprite is a sprite that is always aligned with your screen, facing you). In modern hardware you do this using Point Sprites, but you can render each quad by hand if you wish. This kind of particle system is commonly used to render systems with small particles like rain, smoke, fire or a dust explosion.

Now, you have a second type of particle that is a 'big' particle. This is the kind of particle you get when a missile hits a spaceship and you get big pieces of the ship everywhere. Or when you hit an asteroid and it cracks into smaller chunks of rock. In this case you must control movement and rotation. Each object is created with independent movement but all with a similar behaviour. As a fire is composed of many tiny particles, rendering a cube would be overkill (12 quads against 2 in a sprite) but you may use them in case of a volcano eruption where rocks fly everywhere... and the dust and ashes may be modelled by a sprite particle system.

Luck!
Guimo


Share this post


Link to post
Share on other sites
In GPU Gems, a NVidia demo was detailed where they used bigger billboards with animated fire textures so 1000000s of particles weren't required.
Pity they didn't make the textures accessible though!

EDIT:

I made an enhanced version of the particle system described in 'Special Effects Game Programming' by Mason McCuskey. It's based on DirectX 8 though EDIT:(the book was based on DX8, not my ps).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://www.lighthouse3d.com/opengl/billboarding/ <-- good billboarding tutorial ... but a quick google search for particle systems will show up heaps of tutorials and other wayts todo this!

Share this post


Link to post
Share on other sites

This topic is 4843 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this