Archived

This topic is now archived and is closed to further replies.

malachii

3D Explosions

Recommended Posts

I''m trying to add explosions to my game, and have yet to find an effective method. I would mostly like to know how to display an AVI type of animation (or something similar), perhaps mapped around an expanding sphere. Right now I''m doing just that, except for the animation I''m using a 512x512 texture with 8 128x128 explosion frames inside, and remapping my tu,tv corrdinates accordingly. Is there a better way? 8 frames Isn''t very much. Thanks, Mal.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Most games do one (or both) of two things. If you want just a fire explosion, really all that is going on is a camera facing texture animation of an explosion. If you need to have pieces explode into 3d space, than usually an animation in 3D is played.

Any idea how you want to do you explosion?

/jk

Share this post


Link to post
Share on other sites
Well, a camera facing explosion animation (billboard?) is fine for my application. I simply cannot figure out how to feed multiple frames into the animation. AVI? I''m looking for some kind of demonstration.

Thoughts?

Thanks,

Mal.

Share this post


Link to post
Share on other sites
I believe multiple texture changing fastly on the same object or one texture with different texture coordinate (see sprite)
be haware of memory limitation with multiple texture and also size of the texture if you use one big. for my part even it''s completely outdated on modern hardware I use a max of 256x256
and my game run even on a vodoo2 :-)

Second possibilities 3d object scalling and some particle.
(excellent result)

Dan
<----signature space to rent

Share this post


Link to post
Share on other sites
Take a look in the DirectShow samples which come with the SDK.

There is a sample which used be called VideoTex, it''s now called Texture3D. This shows a video playing onto a texture which is mapped onto a 3D object.

Sounds like it''s what you''re after.

Be aware that with bi-linear filtering you can make your explosion textures MUCH smaller. Some games use as small as 16x16 for explosions which are rendered at around 128x128 on screen! The colours don''t change much - there isn''t any "detail" as such so the filtering isn''t noticable.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Here''s a way to texture map an avi file to anything (as long as the UV coordinates are provided):

First load up the avi file using the AVIFile API. Search the Microsoft Platform SDK.

You can then decode each frame of the avi to a Windows DIB with the call AVIStreamGetFrame(). Then you copy the bitmap pixel data over to a temporary static ImageSurface (of the same format as the initial texture), and then update the texture by calling CopyRects on it.

Of course, you can also use the call IDirect3DDevice8::UpdateTexture(). This just requires you to copy to a IDirect3DBaseTexture8 texture in system memory (source).

Of course, this is assuming that the texture that is being displayed that you want animated is in video memory (D3DPOOL_DEFAULT).




----------------------------------
Leon Hui
Credo Interactive
Bringing Characters to Digital Media
www.lifeforms.com

Share this post


Link to post
Share on other sites