Jump to content
  • Advertisement
Sign in to follow this  
Ksingh30

explosions/Fire

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

can someone please direct me towards a good Explosion/Fire/HLSL tutorial or demo. I would really apperciate it.

Share this post


Link to post
Share on other sites
Advertisement
Ok, well an easy way of doing it would be billboarding. This is a technique wherebye you place a quad at a location and make it face the camera location. On this billboard you play an animation of a fire and since it is always facing you it kinda looks 3D. You can find textures online which contain 16 steps or so of a fire animation and each time interval switch the texture coordinates to the next stage.

Thats how most basic fire is done.

ace

Share this post


Link to post
Share on other sites
I agree that's a simple way in terms of rendering, but it doesn't look any good unless you buy fire animations. Well not if you try to put some reds, oranges and yellows together and try to blur them ;)

Share this post


Link to post
Share on other sites
I think a better way of doing it which isn't much harder than a billboarding is using a single texture and particles. Use the billboard idea of the other one but keep it as one texture. Make a couple of those and each of them should move in an upward motion and slowly fade away. Then have all the particles reset after a few seconds. You can use that for explosions too, just figure out your image type and the direction they move in. Also probly the best type of blending is sourceblend = source alpha, which should start at like 1 to .5 and decrease over time and destinationblending should equal 1, so it adds the values together

Share this post


Link to post
Share on other sites
Quote:

best type of blending is sourceblend = source alpha, which should start at like 1 to .5 and decrease over time

When you say it should have a value of 1 to .5, what param are you referring to? I understand how to set sourceblend and destblend, but where/how do you specify the amount?

I'm looking to implement my particle system in the near future, and I know this is one of those things I'd be asking.

Thanks

Quad

Share this post


Link to post
Share on other sites
For a very nice fire effect I suggest taking a look at the fire example in ATI SDK (you can find the examples on the website). It is done with perturbation shaders in ASM shaders, but I think it wouldn't be too hard to convert them in HLSL.

Share this post


Link to post
Share on other sites
Quote:
When you say it should have a value of 1 to .5, what param are you referring to?

I was talking about the alpha value for the texture. I think you can change it with a D3DMATERIAL9 setting. But if you use a diffuse setting for each vertex, you can change that one. The best would be to use an image of a fire on black and in like a jpg format, (one without alpha). Then set the alpha of the vertex or material, whichever one you are using. And at like each frame, slowly decrease the alpha value until its to zero, then reset the particle

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!