picogl.backend.modern.core.vertex.attribute
Provides a representation of a single vertex attribute slot for the build_vao function.
This class pairs an AttributeSpec (how the
attribute is represented) with the CPU array that will be uploaded.
Classes
One vertex attribute slot for |
Module Contents
- class picogl.backend.modern.core.vertex.attribute.VertexAttribute[source]
One vertex attribute slot for
build_vao().- Parameters:
spec – Vertex attribute layout (index, size, dtype, semantic name).
data – CPU vertex data uploaded into the corresponding VBO.
- data: numpy.ndarray[source]
- classmethod slot(index: int, data: numpy.ndarray, name: picogl.gpu.buffers.vertex.vbo.VBOType | str, *, size: int | None = None, dtype: picogl.backend.gl.enums.GLNumeric = GLNumeric.FLOAT) VertexAttribute[source]
Build a
VertexAttributefrom an index, array, and semantic name.- Parameters:
index – Vertex attribute location.
data – CPU vertex data.
name – Semantic buffer name (e.g.
VBOType).size – Components per vertex; inferred from
datawhen omitted.dtype – OpenGL component type.
- Returns:
Attribute wrapping an
AttributeSpecanddata.