Advertisement

Animated textures

Started by January 15, 2003 07:57 AM
5 comments, last by PM 22 years, 1 month ago
How to use animated textures? Should I first load all the frames as textures and then just bind to another texture id (=frame)? PM
PM Times change... Excuse my poor english!
You may render into a texture, if you want to animate in realtime, or you load every picture of your animation-sequence as a seperate texture (id) and use (bind) a different texture for every frame (for example, explosions are often made this way)
Advertisement
Or a more efficient way can be to tile multiple frames of the animation onto a single texture, and just change the texture coordinates to access the frame you want. This can save you from thrashing heaps textures around on the video card (a state change which can become very costly if you don''t keep an eye on it)

The downside to this method is that you must choose between having an overall texture thatis very big, or each "frame" on the texture must be of lower resolution, or both (in the case of long animations).
Optionally in that method you have to take care of texture filters (in linear filter and mipmaps, you should not get the texel of a neighbour frame) and more important it does not permit texture repeating. That last point is not a problem if you don''t repeat textures (eg animated explosion or short TV animation) but it''s a strong constraint when you really need to repeat (eg animated lava or water).
Thank you all!

I''ll try it ))
PM Times change... Excuse my poor english!
On a "little better" HW you can load animation frames into 3D texture and use 3rd coordinate as time.

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
Advertisement
yup, works for animating 2D textures, but not for animating 3D textures j/k
this has the advantage of offering the linear interpolation feature, which can be useful to smoothen the animation.

This topic is closed to new replies.

Advertisement