Animating Vertex Paint Layer Opacity
 
 
 

In this lesson you will separate the lighting information from the individual objects onto independent layers. We'll show you how its done, then you will load a file that has the work completed.

You'll create the illusion of a flickering fluorescent tube by animating the opacity value of the vertex paint layer, and then keyframing the material self illumination color.

Set up the lesson:

Create separate radiosity layers:

  1. With the garage walls still selected, hold down the Ctrl key, then on the Modify panel select the two VertexPaint modifiers in the stack and delete them using the Remove Modifier From Stack button below the modifier window.

    You can use the Layer Manager to quickly hide and unhide parts of your scene. You'll hide all the lights but one, then create a radiosity pass for that and bake it into a vertex paint layer.

  2. On the toolbar, click the Layer Manager button.

  3. On the Layer Manager dialog, click Hide for all the objects except FlourescentFlicker and Misc.

    Layer Manager

    Now the only objects visible in the scene are the garage elements and the one fluorescent tube.

  4. On the Rendering menu, choose Render. Then on the Advanced Lighting Tab, click Reset. Then click Start.

    The radiosity solution is calculated for the light coming from the single fluorescent tube.

    Radiosity from single fluorescent fixture

    Of course, the next step is to create the vertex color layer.

  5. On the Utilities Panel, click More > Assign Vertex Colors. Make sure the selection set namedVertsPT_set is selected, then click Assign To Selected.

    The lighting coming from the one fluorescent tube is applied to this vertex color layer.

  6. Click the Edit button to jump to the Modify panel.

    In the Modifier stack, highlight the Vertex Paint layer and right-click, then rename it VertexPaint Flicker.

  7. Repeat the procedure for the another light layer. On the Layer Manager, unhide the layer named Fluorescent Lights, and hide the layer named Fluorescent Flicker. Repeat the above steps to reset radiosity, create a new radiosity solution, and assign it to a vertex color layer.

    Radiosity for the rest of the fluorescent tubes.

    You could do the same for the skylights.

    Radiosity for the skylights

    We've provided a finished file that has all the work done for you.

  8. Save your file if you wish, then open tut_vertexpaint_anim_start.max to continue.

Animate the layer opacity:

Now you can create the illusion of a flickering fluorescent tube. The technique you use is simple. You select the layer with the lighting information, then in Auto Key mode, keyframe the opacity of the layer. You'll then complete the illusion by keyframing the self-illumination color of the material.

  1. In the new file you just opened, look at the modifier stack for the VertPT_set objects.

    There are six vertex paint layers in this file.

  2. In the modifier stack, highlight VertPT_Flicker, then click the Edit button to display the vertex paintbox if it isn't already visible.
  3. Turn on the Auto Key button.
  4. Move the time slider to frame 10.
  5. On the floating vertex paintbox, move the opacity slider down slightly, then back to 100.

    This sets a key at frame 10, and frame 0.

  6. Move to frame 12 and slide the opacity slider down to 0.
  7. Move to frame 14 and slide the opacity slider up slightly, then back down to 0.
  8. Advance to frame 16 and slide the opacity slider up to 100.
  9. Play the animation in the viewport. The light flickers once.
  10. Open the Material Editor and find the Flourescent_light material. In the Advanced Lighting Override Material rollout, click the Base Material name.

    The Base material parameters appear.

  11. Move to frame 10 and click the Self-Illumination color swatch. Move the whiteness slider toward grey, then back to white.

    The color swatch is outlined in red, to show it is animated.

  12. Move to frame 12. Change the Self-illumination color to Black using the Whiteness slider.

    Move to frame 14, and keyframe the color as Black again.

  13. Move to frame 16 and keyframe the Self-Illumination back to white.
  14. Turn off Auto Key and close the Material Editor.
  15. In the track bar, drag a selection rectangle around the keys. Hold down Shift and drag the keys to make copies so the flickering repeats.

    If you play the animation now, its a little slow. You can improve the performance by collapsing the layers.

Preserve the flickering layer:

You'll use the Preserve Layer command to keep the animated layer while condensing the remaining ones.

  1. On the Parameters rollout, with the VertPt_Flicker layer still selected, turn on Preserve Layer.
  2. Now highlight the Layer at the top of the stack.
  3. On the floating vertex paintbox, click Condense To Single Layer.

    The five other layers are collapsed into a single layer, while the flicker layer is preserved.

  4. In the Modifier stack drag the Flicker layer so it is at the top of the stack, then play the animation in the viewport.

Summary

In this tutorial you have explored the use of the VertexPaint modifier. You have learned to bake radiosity into vertex color using the Assign Vertex Color Utility, and how to add paint layers in the modify panel. You have learned to animate the opacity of the layers to create a flickering lighting effect that can be exported to a game engine.