GLVERTEXBINDINGDIVIS(3G)
π GLVERTEXBINDINGDIVIS(3G) β the one where your attributes learn to chill
okay so bestie, this is a page from the 3G manual section (OpenGL and friends π), and it's literally all about glVertexBindingDivisor and glVertexArrayBindingDivisor β two functions that change how fast your generic vertex attributes advance. yes that's the whole vibe. let's get into it β¨
β¨ NAME β¨
glVertexBindingDivisor, glVertexArrayBindingDivisor β modify the rate at which generic vertex attributes advance π
πΈ C SPECIFICATION πΈ
void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
void glVertexArrayBindingDivisor(GLuint vaobj, GLuint bindingindex,
GLuint divisor);
look at them. two little icons. π«Ά
π PARAMETERS π
vaobjβ the name of the vertex array object for theglVertexArrayBindingDivisorfunction. that's the VAO you're targeting, bestie.bindingindexβ the index of the binding whose divisor you want to modify. point at it. ππdivisorβ the new value for the instance step rate to apply. the fresh number. β¨
π¦ DESCRIPTION π¦
so glVertexBindingDivisor and glVertexArrayBindingDivisor modify the rate at which generic vertex attributes advance when you're rendering multiple instances of primitives in a single draw command. multi-instance rendering hours, fr fr. π₯
here's the tea on divisor:
- if
divisoris zero, the attributes using the buffer bound tobindingindexadvance once per vertex. one vertex, one step. no cap. πΆββοΈ - if
divisoris non-zero, the attributes advance once perdivisorinstances of the set(s) of vertices being rendered. so like, it paces itself. β¨
and an attribute is referred to as instanced if the corresponding divisor value is non-zero. that's the official terminology, iykyk. π
the difference between the two functions, because yes there is one:
glVertexBindingDivisoruses the currently bound vertex array object.glVertexArrayBindingDivisorupdates the state of the vertex array object with IDvaobj.
same energy, different target. π«
π ERRORS π
GL_INVALID_VALUEis generated ifbindingindexis greater than or equal to the value ofGL_MAX_VERTEX_ATTRIB_BINDINGS. out of range, babe. πGL_INVALID_OPERATIONbyglVertexBindingDivisoris generated if no vertex array object is bound. nothing bound = nothing to do. πGL_INVALID_OPERATIONis generated byglVertexArrayBindingDivisorifvaobjis not the name of an existing vertex array object. ghost VAO. not real. π
π ASSOCIATED GETS π
you can peek at this state with glGet() using these arguments:
GL_MAX_VERTEX_ATTRIB_BINDINGSGL_VERTEX_BINDING_DIVISOR
go check on it. it's giving transparency. π§
π VERSION SUPPORT π
the original ships a big table, but here it is in list form because we're cute like that β every single version is accounted for, promise π«Ά (columns are OpenGL versions 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, and β means supported, - means not):
glVertexArrayBindingDivisorβ-in2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3,4.4;βin4.5. late bloomer, main character energy. πglVertexBindingDivisorβ-in2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2;βin4.3,4.4,4.5. arrived in 4.3 and never left. π₯
π SEE ALSO π
go read these next, bestie, they're all linked up:
glBindVertexBuffer()glVertexAttribBinding()glVertexAttribPointer()glVertexBindingDivisor()glVertexAttribPointer()
(yes glVertexAttribPointer() shows up twice in the original list and yes glVertexBindingDivisor() is listed on its own page β we don't editorialize, we just report. π)
β COPYRIGHT β
Copyright Β© 2013-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 2013-2014 Khronos Group
okay that's the whole page, no notes π go forth and set those divisors, bestie πΈ
mwah π this was [FIXME: source], dated 08/09/2021, and it's the GLVERTEXBINDINGDIVIS(3G) page β see u in the next one π¦
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms