Difference between revisions of "Vertex color"
m (layout) |
EricChadwick (Talk | contribs) (→Vertex alpha: transparency) |
||
Line 6: | Line 6: | ||
= Vertex alpha = | = Vertex alpha = | ||
− | Because vertex alpha is simply a monochrome set of values it can be used for other purposes, like providing transparency, per-vertex sound effects in response to collisions, controlling foliage bend amount for a tree's animated vertex shader, etc. The alpha channel works similar to the RGB channels otherwise. | + | Because vertex alpha is simply a monochrome set of values it can be used for other purposes, like providing [[Transparency_map|transparency]], per-vertex sound effects in response to collisions, controlling foliage bend amount for a tree's animated vertex shader, etc. The alpha channel works similar to the RGB channels otherwise. |
Depending on the game engine and mesh format, a single vertex can be assigned multiple vertex alpha values. This duplicates the vertex, once for each alpha value, which allows the alpha to change suddenly from one triangle to the next, creating a hard alpha edge. | Depending on the game engine and mesh format, a single vertex can be assigned multiple vertex alpha values. This duplicates the vertex, once for each alpha value, which allows the alpha to change suddenly from one triangle to the next, creating a hard alpha edge. |
Revision as of 22:43, 11 December 2014
Vertex color
Each vertex in a mesh can optionally store a RGB color value, called vertex color. These can be used for a variety of interesting effects and shader inputs.
Vertex color can be used for multitexturing, transparency, or ambient occlusion for example.
Vertex alpha
Because vertex alpha is simply a monochrome set of values it can be used for other purposes, like providing transparency, per-vertex sound effects in response to collisions, controlling foliage bend amount for a tree's animated vertex shader, etc. The alpha channel works similar to the RGB channels otherwise.
Depending on the game engine and mesh format, a single vertex can be assigned multiple vertex alpha values. This duplicates the vertex, once for each alpha value, which allows the alpha to change suddenly from one triangle to the next, creating a hard alpha edge.
Usage
Vertex color is typically multiplied against the Diffuse Color, colorizing/darkening the color map.
Vertex color can also be used for controlling blends between different texture sets, providing per-vertex sound effects in response to collisions, controlling which foliage vertices are affected by a "wind" vertex shader, etc.
When used for non-color effects, typically each color channel is treated as a separate monochrome set of values, so for example RGB vertex color can control three different per-vertex effects.
Multiple Colors per Vertex
A single vertex can be assigned multiple vertex colors, depending on the game engine and mesh format. This duplicates the vertex when it is loaded into the game, once for each color, slightly increasing the memory cost. When vertices along an edge contain two different vertex colors, the color may change suddenly from one triangle to the next, creating a hard color edge instead of the typical blending normally seen across vertices. This is typically done by applying color to a face selection rather than vertices. In Maya, Vertex Faces allows for applying color in a vertex/face hybrid mode.
Tutorials
Vertex painting for UDK @ Eat3d |
Foliage Vertex Color |
Ambient occlusion vertex color |
Removing Vertex Colors |
Vertex Color Tutorial for 3ds Max |
Vertex Color Use in Maya Questions |