using 3D image textures sequentially on a model for anim tex

Want to take a stacked set of PNG’s or Jpegs loaded as a 3D texture and apply them onto a model or part of model as a repeating animated sequence. Do not suggest
“egg texture cards” as this creates a card separate from my model and this isn’t what I’m needing. Video textures would be too much of a memory hog. What I’m after is a shader that runs a running frame count the length of the sequence and applies one frame of the seq per video frame, then recycles to the beginning and repeats endlessly. Its intended use is for animated “Irwin Allen” style computer blinkenlights tho it would have many other uses as well ( dripping blood. pulsing veins, non-particle system fire etc. ). Can figure out the parts about creating the seqence loading the 3D texture but not sure how to do things like apply a particular frame from the 3D sampler input to a 2D texture out, how to get the length of the seqence so I don’t need different versions of the shader and so on.

Also not really sure how to find out errors if shader does not compile, debugging shaders etc.

Ultimately what I’m after is a shader that applies two textures, first a static background then applies (decal?) the animation sequence using PNG’s with alpha background atop that.

I think there is a real need for some kind of relatively lightweight shader based texture animation for Panda. Around 2001 I was playing around with a very “minecraft” like engine called Flatland Rover which could apply animated GIF’s to its models… I sure miss that kind of capability.

I’d be willing to work on the problem myself if I just had some info on how to go about it.

Check out the “Texture Swapping” sample, I think it might do what you are looking for.

you don’t even need a shader. just load your 3D texture, apply it, and set the UV coordinate offset (in this case it would be UVW as you have a 3d texture).

bout memory hogging, depending on the length of your animation the 3d texture will eat a lot more memory as it has to keep all frames in memory all the time. while a movie often has only a few frames in memory. cpu load with movies would be higher tho.

I’ve considered doing it that way with script and a task tho I was more looking for a way to move it into the GPU for speed as it is something there will be used in a lot of places at once.

You can easily apply a similar UVW offset when sampling the texture in a shader.

More what I was figuring, load the tex as a 3D set then generate U,V in the usual way but base W on a rolling frame counter. I just haven’t figured out how to pass the length of the texture sequence in to the shader. Want one general version that handles any length but don’t see any way to get the length of the 3D sequence. Animate dream has a terrain shader with a background and detail tex shader that has given me an idea of how the background and overlay might have to work tho. What I’m after is a shader that applies a fixed background image then overlays that with a repeating animation with a transparent back. Irwin Allen “time tunnel” style computer consoles with animated blinkenlites, had considered the texture swapping in script but a whole room full of consoles and screens animated like that would bog down SOOOO BAD.

My big worry is in debugging this, in script if it doesn’t work Idle gives me nice error messages in red text but in shaders it just fails transparently, are there any ways to get shader compilation to give verbose error messages instead of the usual “friendly” thing where Panda just tries to run without the shader???