Since animMap shaders are bugged, (server uptime >24h == animMaps are static), it makes them pretty useless.
However, an animated shader can often make things more fancy.
I was busy creating an animated shader that does not use animMap at all, but is still animated.
It is possible to use up to 8 render-passes in a shader.
My example shader has 1 base texture + 7 animation frames.
All frames of the animation are packed into 1 texture.
The shader itself does a lot of number fiddling, it might need some explaining…
- “tcMod transform” is used to get one of the 7 images of the texture. (the T coordinate is transformed so it starts at the “Y”-position of each sub-texture).
- alphaGen is used to alternate the texture translucency
- rgbGen is used to make the texture colors alternate black/normal
- blendfunc add is used, in the example case, to add the texture to the screen. Blending a black texture this way will have no visual effect, a normal colored texture will be seen on screen…
By choosing the correct intervals at which alpha-values and rgb-colors are changing, You can make only 1 of the 7 images be visible at a time…
In the example i use “wave sine” because it looked well on the caustic effect. When using “wave Square” the transition is immediate.
Here is the example shader:
// C's caustics shader..
// using a faked animMap to display up to 8 textures in an animated sequence..
textures/mapname/fake_animmap
{
{
// this is Your rock/wall/bricks/whatever..
map textures/mapname/basetexture.tga
blendfunc filter
}
{
map textures/mapname/c_caustics.tga
tcMod transform 1 0 0 0.14285714285714285714285714285714 0 0
blendFunc add
alphaGen wave sine 0 1 0 1
rgbGen wave sine 0 0.015 0.35714285714285714285714285714286 1
}
{
map textures/mapname/c_caustics.tga
tcMod transform 1 0 0 0.14285714285714285714285714285714 0 0.14285714285714285714285714285714
blendFunc add
alphaGen wave sine 0 1 0.14285714285714285714285714285714 1
rgbGen wave sine 0 0.015 0.5 1
}
{
map textures/mapname/c_caustics.tga
tcMod transform 1 0 0 0.14285714285714285714285714285714 0 0.28571428571428571428571428571429
blendFunc add
alphaGen wave sine 0 1 0.28571428571428571428571428571429 1
rgbGen wave sine 0 0.015 0.64285714285714285714285714285714 1
}
{
map textures/mapname/c_caustics.tga
tcMod transform 1 0 0 0.14285714285714285714285714285714 0 0.42857142857142857142857142857143
blendFunc add
alphaGen wave sine 0 1 0.42857142857142857142857142857143 1
rgbGen wave sine 0 0.015 0.78571428571428571428571428571429 1
}
{
map textures/mapname/c_caustics.tga
tcMod transform 1 0 0 0.14285714285714285714285714285714 0 0.57142857142857142857142857142857
blendFunc add
alphaGen wave sine 0 1 0.57142857142857142857142857142857 1
rgbGen wave sine 0 0.015 0.92857142857142857142857142857143 1
}
{
map textures/mapname/c_caustics.tga
tcMod transform 1 0 0 0.14285714285714285714285714285714 0 0.71428571428571428571428571428571
blendFunc add
alphaGen wave sine 0 1 0.71428571428571428571428571428571 1
rgbGen wave sine 0 0.015 0.0714285714285714285714285714286 1
}
{
map textures/mapname/c_caustics.tga
tcMod transform 1 0 0 0.14285714285714285714285714285714 0 0.85714285714285714285714285714286
blendFunc add
alphaGen wave sine 0 1 0.85714285714285714285714285714286 1
rgbGen wave sine 0 0.015 0.2142857142857142857142857142857 1
}
}
Maybe someone can do something with this info…

