Archived

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

NotTaxes

Animated Textures?

Recommended Posts

Howdy. Trying to do some nice animated textures, but it''s a real mission. I figure that using animated gifs would be the best choice, but that doesn''t seem to be supported by DX8. The only other way I think of doing it is to use arrays of textures, with a descriptor defining how many images are to be used and at what speed. Any better ways to handle it?

Share this post


Link to post
Share on other sites
you could put the frames all on one texture, and use the tu and vu (i think) arguments to put just a portion of the texture on the surface. then you only have to change this coordinate to animate your surface.

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites
recalculating tu and tv requires that you lock the vertex buffer every frame and that''s expensive.

I use animated textures and the best way I found to implement them was to have a separate bitmap for each frame. Then all I needed to do was select the correct frame as the texture.

The solution is not as pretty as one would be expecting but that''s just the way it is.


D.V.

Carpe Diem

Share this post


Link to post
Share on other sites
Hmmm... but that''s almost the same thing as having an array although it may be a little slower (one large texture moving around in memory instead of just the little tiny piece you need).

Share this post


Link to post
Share on other sites
You can use a transformation matrix for the texture (D3DTRANSFORMSTATE_TEXTURE0 through D3DTRANSFORMSTATE_TEXTURE7) to change the texture coordinates. This should be the fastest method if all frames fit into a single texture.

Share this post


Link to post
Share on other sites