Game Development Reference
2. Pipeline step. The content pipeline processes each colored polygon group
and assigns it an ID.
3. Runtime step. At runtime, the programmer decides to hide all polygons
belonging to a certain ID, so he passes the ID in a bit field to the vertex
shader. The vertex shader collapses the marked polygons, effectively pre-
venting them from rasterizing any pixels. The programmer then renders fill
geometry in place of the hidden polygons.
Next, we delve into the details of each of the above mentioned steps. Then we will
analyze the technique and see if it achieves the goals mentioned in Section 3.2.
3.4.1 Authoring Step
The first step is to decide what damage will appear on the 3D object. For each
enumerated damage area, we assign it a unique color code. This color will be
used to mark polygons of the 3D object to be hidden when the respective damage
is to appear at runtime. Table 3.1 shows an example for a hypothetical character
Once the table is set, the artists use the color-coding scheme to paint poly-
gons of the 3D object belonging to each supported damage area using per-vertex
coloring techniques (see Figure 3.1 ). This is necessary to later allow the program-
mer to hide the polygons at runtime before he renders the replacement damage
It is important to note that even though we are using per-vertex colors, the
artist should restrict the painting to entire polygons, not individual vertices. This
is key to allow proper polygon hiding, otherwise rendering artifacts will appear
In Maya, this can be achieved by selecting the polygons that belong to a
particular damage area and applying the corresponding color code value using
the “Apply Color” command. In Maya 2012, this command can be accessed from
the “Polygons” module under the “Color” menu. In the command options, the
Tab l e 3 . 1 . Damage-area color-code table for a hypothetical character object.