explosions/Fire

Started by
9 comments, last by QuadMV 18 years, 8 months ago
can someone please direct me towards a good Explosion/Fire/HLSL tutorial or demo. I would really apperciate it.
Advertisement
If you download RenderMonkey from ATI you can have a look at their examples that come with it. Its written in HLSL.

ace
I was thinking a little more something for begginers.
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
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 ;)
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
ok how would I do fire with HLSL.
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
3DMUVE is an amateur game development team, and the designer and developer of a new gaming technology “MUVE” for the gaming industry.
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.
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

This topic is closed to new replies.

Advertisement