Vertex Buffer Object
Encyclopedia
A Vertex Buffer Object is an OpenGL
extension that provides methods for uploading data (vertex
, normal vector, color, etc.) to the video device for non-immediate-mode rendering. VBOs offer substantial performance gains over immediate mode rendering primarily because the data resides in the video device memory rather than the system memory and so it can be rendered directly by the video device.
The Vertex Buffer Object specification has been standardized by the OpenGL Architecture Review Board as of OpenGL
Version 1.5. Similar functionality was available before the standardization of VBOs via the Nvidia
-created extension "Vertex Array Range" or the ATI
's "Vertex Array Object" extension.
Vertex Shader:
Fragment Shader:
Main OpenGL Program:
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...
extension that provides methods for uploading data (vertex
Vertex (geometry)
In geometry, a vertex is a special kind of point that describes the corners or intersections of geometric shapes.-Of an angle:...
, normal vector, color, etc.) to the video device for non-immediate-mode rendering. VBOs offer substantial performance gains over immediate mode rendering primarily because the data resides in the video device memory rather than the system memory and so it can be rendered directly by the video device.
The Vertex Buffer Object specification has been standardized by the OpenGL Architecture Review Board as of OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...
Version 1.5. Similar functionality was available before the standardization of VBOs via the Nvidia
NVIDIA
Nvidia is an American global technology company based in Santa Clara, California. Nvidia is best known for its graphics processors . Nvidia and chief rival AMD Graphics Techonologies have dominated the high performance GPU market, pushing other manufacturers to smaller, niche roles...
-created extension "Vertex Array Range" or the ATI
Ati
As a word, Ati may refer to:* Ati, a town in Chad* Ati, a Negrito ethnic group in the Philippines* Ati-Atihan Festival, an annual celebration held in the Philippines* Ati, a queen of the fabled Land of Punt in Africa...
's "Vertex Array Object" extension.
Basic VBO functions
The following functions form the core of VBO access and manipulation:- In OpenGL 2.1 :
- GenBuffersARB(sizei n, uint *buffers)
- Generates a new VBO and returns its ID number as an unsigned integer. Id 0 is reserved.
- GenBuffersARB(sizei n, uint *buffers)
-
- BindBufferARB(enum target, uint buffer)
- Use a previously created buffer as the active VBO.
- BindBufferARB(enum target, uint buffer)
-
- BufferDataARB(enum target, sizeiptrARB size, const void *data, enum usage)
- Upload data to the active VBO.
- BufferDataARB(enum target, sizeiptrARB size, const void *data, enum usage)
-
- DeleteBuffersARB(sizei n, const uint *buffers)
- Deletes the specified number of VBOs from the supplied array or VBO id.
- DeleteBuffersARB(sizei n, const uint *buffers)
- In OpenGL 3.x and OpenGL 4.x :
- GenBuffers(sizei n, uint *buffers)
- Generates a new VBO and returns its ID number as an unsigned integer. Id 0 is reserved.
- GenBuffers(sizei n, uint *buffers)
-
- BindBuffer(enum target, uint buffer)
- Use a previously created buffer as the active VBO.
- BindBuffer(enum target, uint buffer)
-
- BufferData(enum target, sizeiptrARB size, const void *data, enum usage)
- Upload data to the active VBO.
- BufferData(enum target, sizeiptrARB size, const void *data, enum usage)
-
- DeleteBuffers(sizei n, const uint *buffers)
- Deletes the specified number of VBOs from the supplied array or VBO id.
- DeleteBuffers(sizei n, const uint *buffers)
Example usage in C Using OpenGL 2.1
Example usage in C Using OpenGL 3.x and OpenGL 4.x
Function which can read any text or binary file into char buffer:Vertex Shader:
Fragment Shader:
Main OpenGL Program: