logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

glVertexAttribDivisor - modify the rate at which generic vertex attributes advance during instanced

C Specification

voidglVertexAttribDivisor(GLuintindex,GLuintdivisor);

Description

glVertexAttribDivisor modifies the rate at which generic vertex attributes advance when rendering
       multiple instances of primitives in a single draw call. If divisor is zero, the attribute at slot index
       advances once per vertex. If divisor is non-zero, the attribute advances once per divisor instances of
       the set(s) of vertices being rendered. An attribute is referred to as instanced if its
       GL_VERTEX_ATTRIB_ARRAY_DIVISOR value is non-zero.

       index must be less than the value of GL_MAX_VERTEX_ATTRIBS.

Errors

GL_INVALID_VALUE is generated if index is greater than or equal to the value of GL_MAX_VERTEX_ATTRIBS.

Name

       glVertexAttribDivisor - modify the rate at which generic vertex attributes advance during instanced
       rendering

Notes

glVertexAttribDivisor is available only if the GL version is 3.3 or higher.

Parameters

index
           Specify the index of the generic vertex attribute.

       divisor
           Specify the number of instances that will pass between updates of the generic attribute at slot
           index.

See Also

glVertexAttribPointer(), glEnableVertexAttribArray(),

       glDisableVertexAttribArray

Version Support

       ┌───────────────────────┬───────────────────────────────────────────────────────────────────────┐
       │                       │                OpenGLVersion                                         │
       ├───────────────────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
       │ Function2.02.13.03.13.23.34.04.14.24.34.44.5 │
       │ /                     │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Feature               │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Name                  │     │     │     │     │     │     │     │     │     │     │     │     │
       ├───────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
       │ glVertexAttribDivisor │  -  │  -  │  -  │  -  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │
       └───────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘

See Also