Home Technical Talk

animated textures for games

polycounter lvl 18
Offline / Send Message
Archanex polycounter lvl 18
Does anyone know how animated textures work in game engines?
for example some games handle a character blinking with an animated texture. Kingdom Hearts did this for lip sync.Is there a way to simulate this in Max? Thanks

Replies

  • animatr
    Options
    Offline / Send Message
    animatr polycounter lvl 18
    yeah man, in Max, use the Mix material. It's animatable.
    As for game engines, ....?....
  • Illusions
    Options
    Offline / Send Message
    Illusions polycounter lvl 18
    Your going to need a texture sequence. Ie. something that has a number either at the beginning or end of the name. Like:

    image_01, image_02, image_03 ... etc. You can make this in any image program. Then in Max, do what you normally would to load a texture, except when you go to choose the image file, if max detects that the folder you're browsing in has an image sequence, it will allow you to select the 'sequence' check box towards the bottom of the browser window. If the sequence check box is selected you'll get another window where you get set the animations playback properties.
  • animatr
    Options
    Offline / Send Message
    animatr polycounter lvl 18
    yes, but would that work for an eye blink? seems like you wouldn't have any control over the timing of that or anything.
    Or do you get some control over it that way? I just did a test, and it works, kind of. But it seems that it capped my end frame at 2. I could only control the multiplier and the every nth frame box. weird. so if you were doing an animation, it seems kind of random.

    the mix material at least gives you that control over when you want it to switch mats and ovr how long.

    Or is there another trick to it with the image sequencing?
  • Illusions
    Options
    Offline / Send Message
    Illusions polycounter lvl 18
    Well you could go in and edit the .ifl file it creates using Notepad. That'll give you some control over whats going on that isn't present in the pop-up window.
  • Eric Chadwick
    Options
    Offline / Send Message
    Lip-synch or eyes blinking via texture swapping is usually done with some code, so the code can trigger the swap according to specific events.

    Blinking could be something like "randomly swap to the shut eye bitmap then immediately back to the open eye bitmap, but never allow the frequency to be faster than 3 seconds."

    Lip-synch would be coded as assigning specific bitmaps to specific letters or combos, then as the text is "read" by the character, the right bitmaps are auto-swapped at the right times.

    Animated texture, like ocean waves or smoke, are usually frowned upon in games. They take up too much memory. Instead tricks are used to make a couple bitmaps move/rotate/scale over time, to mimic the animation. Less bitmaps = better performance.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    a useful alternative is combining sprites/sequences to a single texture and then animating texcoords, however then you loose tiling ability (unless more costly pixelshaders are used).

    emulating the "coded" effects as Eric pointed out, would be best done via maxscript, else you would need to set too many keys manually.
Sign In or Register to comment.