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 and this can have larger performance penalty.

Registry Link

https://www.khronos.org/registry/gles/extensions/OES/OES_draw_elements_base_vertex.txt

Example

glDrawElementsBaseVertexOES(TRIANGLES, 6, UNSIGNED_BYTE, &indices, 100) 
//[[ If OpenGL ES 3.0 is supported: ]] 
glDrawRangeElementsBaseVertexOES(TRIANGLES, 0, 200, 
                                  6, UNSIGNED_BYTE, 
                                      &indices, 100); 
glDrawElementsInstancedBaseVertexOES(TRIANGLES, 6, 
                                            UNSIGNED_BYTE, &indices, 
                                            10, 100); 
//[[ If EXT_multi_draw_arrays is supported: ]] 
glMultiDrawElementsBaseVertexOES(TRIANGLES, 
                                        &count, 
                                        UNSIGNED_BYTE, 
                                        &indices, 
                                        10, 
                                        &basevertex);