GL_EXT_draw_elements_base_vertex

Supported Hardware

Series6, Series6XE, Series6XT

Valid APIs

Requires OpenGL ES 2.0

Description

This extension provides a method to specify a “base vertex offset” value which is effectively added to every vertex index that is transferred through DrawElements.

This mechanism can be used to decouple a set of indices from the actual vertex array that it is referencing. This is useful if an application stores multiple indexed models in a single vertex array. The same index array can be used to draw the model no matter where it ends up in a larger vertex array simply by changing the base vertex value. Without this functionality, it would be necessary to rebind all the vertex attributes every time geometry is switched which can have a larger performance penalty.

Example

glDrawElementsBaseVertexEXT(TRIANGLES, 6, UNSIGNED_BYTE, &indices, 100)
//[[ If OpenGL ES 3.0 is supported: ]]
glDrawRangeElementsBaseVertexEXT(TRIANGLES, 0, 200,
                                        6, UNSIGNED_BYTE,
                                        &indices, 100);
glDrawElementsInstancedBaseVertexEXT(TRIANGLES, 6,
                                            UNSIGNED_BYTE, &indices,
                                            10, 100);
//[[ If EXT_multi_draw_arrays is supported: ]]
glMultiDrawElementsBaseVertexEXT(TRIANGLES,
                                        &count,
                                        UNSIGNED_BYTE,
                                        &indices,
                                        10,
                                        &basevertex);