Main | API | WebRender | loadVBO


loadVBO(vbo, data);

Loads the vertex buffer with the given data.


vbo - [Unsigned Integer]

The id of the vertex buffer that is being loaded into.

data - [Float32Array]

An array containing all the vertex data. Must be a Float32Array.




This function loads the vertex data into the vertex buffer with the id that is given. ALl the data must be in a Float32Array, as that is what the pipeline works with for interpolation. The ordering of the data is defined by the shader program that you intend to use it with. WebRender only supports basic interleaved vertex data, every three vertices in a row is a single triangle and all data for each vertex is stored together.

For example, a single triangle looks like this: [V1.x, V1.y, V1.z, V1.u, V1.v, V2.x, V2.y, V2.z, V2.u, V2.v, V3.x, V3.y, V3.z, V3.u, V3.v]. Then after that another three vertices would be placed to form another triangle. This format was chosen to reduce complexity in the vertex sampling section of the pipeline, however it does require more memory than more advanced vertex formats found in other libraries.

See more detailed information about vertex buffers here.

See more detailed information about shaders here.

Additional Notes