GLDRAWELEMENTSINSTAN(3G)

πŸ’… GLDRAWELEMENTSINSTAN(3G) β€” glDrawElementsInstancedBaseVertex

okay bestie, welcome to the 3G manual page for glDrawElementsInstancedBaseVertex, aka the "render multiple instances of a set of primitives from array data with a per-element offset" icon. no cap, this one is a whole vibe if you're doing instanced indexed drawing. πŸ¦‹βœ¨


🌸 NAME 🌸

glDrawElementsInstancedBaseVertex β€” render multiple instances of a set of primitives from array data with a per-element offset. that's the NAME section, periodt. πŸ’–


✨ C SPECIFICATION ✨

void glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
                                       GLenum type, GLvoid *indices,
                                       GLsizei primcount,
                                       GLint basevertex);

πŸŽ€ PARAMETERS πŸŽ€

  • mode β€” tells the GL what kind of primitives to render. the accepted symbolic constants are GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_LINES_ADJACENCY, GL_LINE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY, GL_TRIANGLE_STRIP_ADJACENCY and GL_PATCHES. pick your fave, but it has to be one of those. πŸ‘‘
  • count β€” the number of elements to be rendered. literally how many, bestie. πŸ”’
  • type β€” the type of the values in indices. must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. no mixing, no guessing. πŸ’…
  • indices β€” a pointer to the location where the indices are stored. that's the address, not the vibe. πŸ“
  • primcount β€” the number of instances of the indexed geometry that should be drawn. yes, we're doing multiples, main character energy. 🌈
  • basevertex β€” a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays. it's the little offset that could. ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

glDrawElementsInstancedBaseVertex behaves identically to glDrawElementsInstanced() except that the *i*th element transferred by the corresponding draw call will be taken from element indices[i] + basevertex of each enabled array. iykyk. πŸ’–

if the resulting value is larger than the maximum value representable by type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). and listen: the operation is undefined if the sum would be negative. that's a hard no, not a cute experiment. 😭


🧚 NOTES 🧚

glDrawElementsInstancedBaseVertex is only supported if the GL version is 3.2 or greater. old GL? not invited to this party. 🫢


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_ENUM is generated if mode is not an accepted value. 🚫
  • GL_INVALID_VALUE is generated if count or primcount is negative. negative counts are not the vibe. πŸ™ˆ
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object. 🧚
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped. mapping drama = error, bestie. πŸ’…

⭐ VERSION SUPPORT ⭐

OpenGL Version β€” Function / Feature Name: glDrawElementsInstancedBaseVertex

  • 2.0: -
  • 2.1: -
  • 3.0: -
  • 3.1: -
  • 3.2: βœ”
  • 3.3: βœ”
  • 4.0: βœ”
  • 4.1: βœ”
  • 4.2: βœ”
  • 4.3: βœ”
  • 4.4: βœ”
  • 4.5: βœ”

so like: dashes for 2.0 through 3.1, checks from 3.2 all the way to 4.5. slay. βœ…


πŸ”₯ SEE ALSO πŸ”₯

  • glDrawElements()
  • glDrawRangeElements()
  • glDrawRangeElementsBaseVertex()
  • glDrawElementsInstanced()
  • glDrawElementsInstancedBaseVertex()

go read those if you want the full friend group. 🫢


Copyright Β© 2010-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 Β© 2010-2014 Khronos Group


okay that's the whole page, bestie πŸ’œ β€” signing off with [FIXME: source] energy, dated 08/09/2021, manual slot GLDRAWELEMENTSINSTAN(3G). mwah. πŸ’‹βœ¨

πŸ“¦ where this page comes from