IT lexicon › Programming › Index buffer

Index buffer

Programming På svenska → Updated: 2026-10-25

A buffer of integer indices into a vertex buffer, letting a mesh reuse each shared vertex once instead of duplicating it for every triangle that touches it.

A cube has 8 corners but 12 triangles = 36 vertex references; storing 36 full vertices wastes memory and defeats the GPU's vertex cache. An index buffer (called an Index Buffer Object or Element Buffer Object in OpenGL, GL_ELEMENT_ARRAY_BUFFER) stores 36 small indices pointing at the 8 unique vertices, which live once in the vertex buffer.

Indexed drawing (glDrawElements, DrawIndexed) also lets the post-transform vertex cache skip re-running the vertex shader for a vertex it just processed. Indices are usually 16-bit (up to 65,536 vertices) or 32-bit; picking the smaller one that fits halves the bandwidth.

← Back to the lexicon