Home Technical Talk

Animating Vertex Colors

polycounter lvl 7
Offline / Send Message
Computron polycounter lvl 7
Is it possible to animate vertex colors in 3ds max and will these export into UDK or Unity? I'm thinking of possibly doing some cool dynamic vertex lighting effects, like if I baked ambient occlusion into a characters vertices at each keyframe.

Replies

  • keres
    Options
    Offline / Send Message
    keres polycounter lvl 12
    Not that I am aware of with UDK. Why would you want to do this, anyway? I can think of many different ways to do better vertex ambient occlusion than to animate them in 3ds Max.
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    Elaborate please? I was thinking to use if for some moving props in a map for an iPhone game maybe.
  • Eric Chadwick
    Options
    Offline / Send Message
    I think you would need to export each animation frame as a morph target, as a separate mesh. Which would be super expensive.

    But you might be able to do some programmatic animation effects. Like color cycling the existing colors, or brightness/contrast/hue/saturation/etc. Like, you could fade out the vertex color over time. After all, it is just a bunch of numbers stored in each vertex.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Even if you can do that, I'm not sure that the UDK can handle animated vertex color. Yes you can edit the vertex color, but every frame I don't think so. The only thing that you can do is animating the material with an the effect that use to affect the geometry through the vertex colors.
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    I know FBX import to UDK only supports one color set, not totally sure about ActorX, so that rules out transitioning between different color sets.
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    FBX is for static meshes, meaning no animations, wouldn't work.

    I don't see why it would need it to be morph targets, I just need it to lerp between colors at each keyframe, I dont need the coordinates as well.

    It looks like no engine does this, so is there some better way to animate ambient occlusion? I could only find this whitepaper online, but it requires access to skeletons and isnt readily availible in engines like UDK or unity: http://www.tml.tkk.fi/~janne/aoc/aoc.pdf
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    Computron wrote: »
    FBX is for static meshes, meaning no animations, wouldn't work.

    UDK's FBX importer can import skeletal meshes and animations just fine
    http://udn.epicgames.com/Three/FBXImporterUserGuide.html
  • Rick Stirling
    Options
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    You'd be better to use the vertex colours as an index that points to a row on a texture. The next row on the texture would be the next set of colours that you wanted animated - pretty much like how we used to colour animated sprites back in the day.

    It means you'd only need one mesh, not several, no morphs - just do it all in the shader.
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    Computron wrote: »
    FBX is for static meshes, meaning no animations, wouldn't work.

    I don't see why it would need it to be morph targets, I just need it to lerp between colors at each keyframe, I dont need the coordinates as well.

    It looks like no engine does this, so is there some better way to animate ambient occlusion? I could only find this whitepaper online, but it requires access to skeletons and isnt readily availible in engines like UDK or unity: http://www.tml.tkk.fi/~janne/aoc/aoc.pdf

    Realtime animation systems dont operate per vertex, and havent since the mid 90s. If you wanted to store information per vertex per "frame" you would have to create your own animation system (for example morph targets), which is completely possible in Unity, but would not be ideal for a mobile device at a reasonable speed without some advanced shader features, unless the geometry is REALLY low res.

    Creating a morph target like system that is very optimized using the gpu requires that the hardware be able to do texture samples in the vertex program, which afaik no mobile devices can do. Of course you could create very low res animated lightmaps and lerp them very cheaply on a mobile device, so if you absolutely need that kind of lighting animation thats probably the way to go. If its just for a character you will never see the difference between animated AO and AO baked into the diffuse map so there is no point.
Sign In or Register to comment.