Vertex (computer graphics)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
For other uses, see Vertex (disambiguation).

A vertex (plural vertices) in computer graphics is a data structure that describes certain attributes, like the position of a point in 2D or 3D space, at multiple points on a surface.

Application to 3D models[edit]

3D models are most-often represented as triangulated polyhedra forming a triangle mesh. Non triangular surfaces can be converted to an array of triangles through tessellation. Attributes from the vertices are typically interpolated across mesh surfaces.

Vertex attributes[edit]

The vertices of triangles are associated not only with spatial position but also with other values used to render the object correctly. Most attributes of a vertex represent vectors in the space to be rendered. These vectors are typically 1 (x), 2 (x, y), or 3 (x, y, z) dimensional and can include a fourth homogeneous coordinate (w). These values are given meaning by a material description. In realtime rendering these properties are used by a vertex shader or vertex pipeline.

Such attributes can include:

Position
2D or 3D coordinates representing a position in space
Color
Typically diffuse or specular RGB values, either representing surface colour or precomputed lighting information.
Reflectance
of the surface at the vertex, e.g. specular exponent, metallicity, frenel values.
Texture coordinates
Also known as UV coordinates,these control the texture mapping of the surface, possibly for multiple layers.
normal vectors
These define an approximated curved surface at the location of the vertex, used for lighting calculations (such as Phong shading), normal mapping, or displacement mapping, and to control subdivision.
tangent vectors
These define an approximated curved surface at the location of the vertex, used for lighting calculations (such as Phong shading), normal mapping, or displacement mapping, and to control subdivision.
Blend weights
Bone weights
Weighting for assignment to bones to control deformation in skeletal animation.
Blend shapes
Multiple position vectors may be specified to be blended over time, especially for facial animation.

Vertex attributes in OpenGL[edit]

The following is a table of built in attributes of vertices in the OpenGL standard.

OpenGL vertex attributes[1]
GL attribute name attribute defined (data value size)
gl_Vertex Position (vec4)
gl_Normal Normal (vec4)
gl_Color Primary color of vertex (vec4)
gl_MultiTexCoord0 Texture coordinate of texture unit 0 (vec4)
gl_MultiTexCoord1 Texture coordinate of texture unit 1 (vec4)
gl_MultiTexCoord2 Texture coordinate of texture unit 2 (vec4)
gl_MultiTexCoord3 Texture coordinate of texture unit 3 (vec4)
gl_MultiTexCoord4 Texture coordinate of texture unit 4 (vec4)
gl_MultiTexCoord5 Texture coordinate of texture unit 5 (vec4)
gl_MultiTexCoord6 Texture coordinate of texture unit 6 (vec4)
gl_MultiTexCoord7 Texture coordinate of texture unit 7 (vec4)
gl_FogCoord Fog Coord (float)

See also[edit]

For how vertices are processed on 3D graphics cards, see shader.

References[edit]

  1. ^ Christen, Martin. "Clockworkcoders Tutorials: Vertex Attributes". Khronos Group. Retrieved 26 January 2009.