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

VertexAttribute

One vertex attribute slot for build_vao().

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.

spec: picogl.gpu.buffers.attributes.AttributeSpec[source]
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 VertexAttribute from 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 data when omitted.

  • dtype – OpenGL component type.

Returns:

Attribute wrapping an AttributeSpec and data.