Vertex Functions

From ENIGMA
Revision as of 11:03, 30 October 2013 by RobertBColton (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Vertex ordering for various primitive types with clockwise orientation.

This article is an overview of vertex related functions, they can be used to specify custom vertex formats that can allow multitexturing. In modern graphics programming primitives and models are rendered from vertex buffers in OpenGL and Direct3D, what this means is that the data for vertices and texture coordinates are packed together inside a buffer and sent to your graphics card and rendered by the GPU. Modern graphics cards are designed to do one thing very well, and that is to draw lots and lots of triangles. By constantly sending vertex and texture coordinate data and normals to the GPU you interfere with the graphics pipeline, and this can cause slow downs in games. So it is best to use vertex buffers and buffer primitives only one time and let them sit on the GPU without interference. OpenGL 1 graphics system does not utilize this behavior as older graphics cards may not support this, however OpenGL 3 and Direct3D 9 and later graphics systems do utilize this for models. These functions give you more control over your vertex buffer by letting you specify custom formats and do multitexturing so that you only send what you absolutely need to send to the GPU.

These functions add vertex position, diffuse, UV, and normal data.

These functions let you add the vertex data in a custom way yourself.

The vertex format functions let you specify exactly what format your model is in, and for instance how many texture coordinates each vertice in the primitive contains, effectively allowing you to multitexture.