Using Vertex Colors


When creating models that are for games, the size of the texture map can be prohibitive. I mean, what model that weighs in at 16KB or less wants to carry around a 2MB texture map? The solution that much of the gaming world relies on is to apply a single color to a vertex. Having each vertex remember its color (or even several colors) requires very little additional information for the mesh and can create some good shading. Colors are then interpolated across the face of the polygon between two different colors on adjacent vertices.

The results aren't as clean and detailed as a texture map, but for their size, vertex colors are worth the price.

Assigning vertex colors

Vertex colors can be assigned in the Surface Properties rollout for Editable Mesh and Editable Patch objects, and in the Vertex and Polygon Properties rollouts for Editable Poly objects. They also can be assigned in Face, Polygon, and Element subobject modes using a little rollout section called Edit Vertex Colors. Within this section are two color swatches for selecting Color and Illumination values. The Alpha value sets the alpha transparency value for the vertex.

Painting vertices with the Vertex Paint modifier

Another, more interactive way to color vertices is with the Vertex Paint modifier. This modifier lets you paint on an object by specifying a color for each vertex. If adjacent vertices have different colors assigned, then a gradient is created across the face. The benefit of this coloring option is that it is very efficient and requires almost no memory.

The Vertex Paint modifier lets you specify a color and paint directly on the surface of an object by painting the vertices. The color is applied with a paintbrush-shaped cursor. The modifier can be applied multiple times to an object, giving you the ability to blend several layers of vertex paints together. You can find this modifier in the Modifiers image from book Mesh Editing submenu.

Note 

Once the VertexPaint modifier has been applied to an object, the Paintbox automatically reappears whenever the object is reselected.

Applying this modifier opens a VertexPaint dialog box called the Paintbox, shown in Figure 25.10. At the top of the Paintbox are four icons that can be used to show the visible results of the painting in the viewports. The options include Vertex Color Display-Unshaded, Vertex Color Display-Shaded, Disable Vertex Color Display, and Toggle Texture Display On/Off.

image from book
Figure 25.10: The Paintbox palette for the Vertex Paint modifier includes a wealth of features

The Vertex Color icon flyout lets you work on the Vertex Color, Illumination, Alpha, or any one of the 99 available map channels. The lock icon locks the display to the selected channel, or you could be looking at a different channel than the one you are painting.

The large Paint and Erase buttons let you add or remove vertex colors using the color specified in the color swatch. You can also select colors from objects in the viewports using the eyedropper tool and then set the Opacity.

The Size value determines the size of the brush used to paint. Max supports pressure-sensitive devices such as a graphics tablet, and you can set the brush options using the Brush Options dialog box. When paining on the surface of an object, a blue normal line appears. This line guides you as you paint so that you know you're on the correct surface.

CROSS-REF 

The Painter Options dialog box also is used by the Skin modifier and the Paint Deformation tool. It is described in detail in Chapter 15, "Modeling with Polygons."

Beneath the Brush Options button is a Palette button that opens the Color Palette interface, shown in Figure 25.11. The Color Palette holds custom colors and lets you copy and paste colors between the different swatches. Collections of colors can be saved by right-clicking the Color Palette and selecting the Save As command. Color palettes are saved as Color Clipboard files with the .ccb extension.

image from book
Figure 25.11: The Color Palette can display colors as a list or as swatches

The Paintbox also includes three subobject selection icons. These icons can be used to select certain Vertices, Faces, or Elements to be painted. This limits the painting to the selected subobjects only. You can also select to Ignore Backfacing and use Soft Selection.

The Blur brush button lets you blur colors across polygons using a brush that works just like the Paint and Erase brushes.

The Adjust Color dialog box lets you change all the painted colors applied to an object using HSV or RGB color sliders. The Preview option makes the color adjustment visible in the viewports if selected. Below the Adjust Color icon is the Blur Selected icon that blurs together all the vertex colors based on the designated Amount value.

Colors can be mixed between layers using the various blending modes. Clicking the New Layer button adds a new instance of the Vertex Paint modifier to the Modifier Stack; the Delete Layer button does the opposite.

Click the Condense to a Single Layer button to merge all the consecutive Vertex Paint modifiers to a single instance using the selected blending mode.

Note 

Any files that are opened within 3ds Max 9 that have an older version of the Vertex Paint modifier are displayed as OldVertexPaint in the Modifier Stack.

Tutorial: Marking heart tension

As an example of using the Vertex Paint modifier, imagine a doctor who has a 3D model of the human heart. While discussing the results of the latest test with a patient, the doctor can color parts of the heart model to illustrate the various points.

To color on a human heart using the Vertex Paint modifier, follow these steps:

  1. Open the image from book Vertex paint on heart.max file from the Chap 25 directory on the DVD. This file includes a heart mesh created by Viewpoint Datalabs.

  2. Select a portion of the heart model, and choose Modifiers image from book Mesh Editing image from book Vertex Paint to apply the Vertex Paint modifier.

  3. In the Paintbox that opens, choose the Vertex Color Display-Shaded button at the top of the VertexPaint dialog box, select the red color, and click the Paint button. Then drag the mouse over the surface of the Perspective view.

Figure 25.12 shows the resulting color.

image from book
Figure 25.12: The Vertex Paint modifier can apply color to an object by assigning a color to its vertices

The Assign Vertex Color utility

The Assign Vertex Color utility works a little differently. It converts any existing material colors to vertex colors. To use this utility, select the utility from the Utilities list that opens when the More button in the Utility panel is clicked, select an object, choose a Channel, choose a Light Model (Lighting + Diffuse, Lighting Only, or Diffuse Only), and click the Assign to Selected button.




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net