The Creation Of A Fog/Smoke Effect In Direct3D

Started by
1 comment, last by ErikLong 23 years, 11 months ago
To Whom It May Concern, Hello. I am Erik Long. Right now I am programming a 3D video game in Microsoft Visual Basic 6.0. I am employing Direct3D in this application. So far everything has been running right on schedule. I was able to create the environment objects and the overall environment itself without too much trouble. However, now my project has reached somewhat of a stand-still. You see, my video game is a 3D, first-person shooter, wargame. It is based on the American Civil War. Right now, I am developing the first level, which is a recreation of the Union bombardment on the Confederate held Fort Pulaski. Most of the action in this scene consists of bombs flying back and forth across the Savannah River. I have been able to create the bombs, (in wireframe) and fire them across the level. There is really only one detail missing, that being the fact that I cannot create a fog/smoke effect for the bombs. I need a way to create a smoke like mesh/entity, get it to follow behind the fired bombs and expand as they explode. I have made a note of the "fog" mode in the Direct3D library but am having trouble invoking it. Mainly because I do not know how. I simply need an example of code that would perform the above function. I would appreciate any help that I can get with this. I am very desperate. If you have any suggestions, comments, or a solution to this inquiry, please, feel free to e-mail me at : ErikLong@Mail.Com or reply to this thread (yes, the one that you are reading). You can also ICQ me at UIN: 42084722. Thank you all so very much. Cordially, Erik Long ErikLong@Mail.Com ICQ UIN: 42084722
Advertisement
Make a cloudy smoke texture with alpha channel in it, so you have basically a ''piece of smoke'' Now, when your bomb flies, spawn squares facing the viewer (''billboarding'') behind your rocket. For every frame, move the squares up (smoke rises), enlarge them (a smoke plume gets larger) and increase their transparency (a smoke plume dissolves in air)

Hope this helps,
DaBit.


The MS 7.0 documentation also has some great examples for fog, use of alpha channels, and billboarding. The SDK documentation gives a pretty thorough discussion as well.

Sieggy

This topic is closed to new replies.

Advertisement