Animated strips are materials that scroll in steps across an image simulated animation. Below are example shaders and images from a fire animated shader used in Quake 4.
Shader
gfx/effects/fire/flame1 { qer_editorimage gfx/effects/fire/flame_strip.tga noSelfShadow translucent noShadows twosided { blend add map gfx/effects/fire/flame_strip.tga scale 1 / 32 , 1 scroll table32[ time * .6 ] , 0 clamp vertexColor } }
The important lines to notice are:
scale 1 / 32 , 1 This adjusts the scale of the image to only show 1/32th of its width. The image has exactly 32 parts. The height stays at the default of 1.
scroll table32[ time * .6 ] , 0
This scrolls the image horizontally using a table named table32:
table table32 { snap { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ,24, 25, 26, 27, 28, 29, 30, 31 } }
- The table used must match exactly the scale dimensions to animate correctly. If you are using an image with 16 parts, you need a scale of 1/16 and a table that works in 16 steps.
Images
The animated fire image has 32 parts to it, each 128 pixels wide. This image has been resized to fit.
Here is a close-up of a part of the image.