Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd::VertexElement Struct Reference

Describes one interleaved vertex attribute within a VBO. More...

#include <VertexLayout.h>

Public Attributes

GLuint index
 Shader attribute location (layout(location = N)).
 
GLuint size
 Number of components (e.g. 3 for a vec3 position).
 
GLuint type
 GL data type constant (e.g. GL_FLOAT).
 
uint32_t offset
 Byte offset from the start of one vertex.
 

Static Public Attributes

static constexpr int PositionIndex = 0
 Canonical attribute slot indices — must match the GLSL layout locations.
 
static constexpr int ColorIndex = 1
 layout(location = 1) vec3 aColor
 
static constexpr int UVIndex = 2
 layout(location = 2) vec2 aUV
 
static constexpr int NormalIndex = 3
 layout(location = 3) vec3 aNormal
 
static constexpr int BoneIndicesIndex = 4
 layout(location = 4) ivec4 aBoneIndices
 
static constexpr int BoneWeightsIndex = 5
 layout(location = 5) vec4 aBoneWeights
 

Detailed Description

Describes one interleaved vertex attribute within a VBO.

Maps directly to a glVertexAttribPointer call:

  • index → attrib location in the vertex shader.
  • size → component count (1–4).
  • type → GL data type (typically GL_FLOAT).
  • offset → byte offset from the start of the vertex struct.

Definition at line 42 of file VertexLayout.h.

Member Data Documentation

◆ BoneIndicesIndex

constexpr int mnd::VertexElement::BoneIndicesIndex = 4
staticconstexpr

layout(location = 4) ivec4 aBoneIndices

Definition at line 55 of file VertexLayout.h.

◆ BoneWeightsIndex

constexpr int mnd::VertexElement::BoneWeightsIndex = 5
staticconstexpr

layout(location = 5) vec4 aBoneWeights

Definition at line 56 of file VertexLayout.h.

◆ ColorIndex

constexpr int mnd::VertexElement::ColorIndex = 1
staticconstexpr

layout(location = 1) vec3 aColor

Definition at line 52 of file VertexLayout.h.

Referenced by mnd::Mesh::CreateBox(), mnd::Mesh::CreateCube(), and mnd::ParseGLTFNode().

◆ index

GLuint mnd::VertexElement::index

Shader attribute location (layout(location = N)).

Definition at line 44 of file VertexLayout.h.

Referenced by mnd::ParseGLTFNode().

◆ NormalIndex

constexpr int mnd::VertexElement::NormalIndex = 3
staticconstexpr

layout(location = 3) vec3 aNormal

Definition at line 54 of file VertexLayout.h.

Referenced by mnd::Mesh::CreateBox(), mnd::Mesh::CreateCapsule(), mnd::Mesh::CreateCube(), mnd::Mesh::CreateSphere(), and mnd::ParseGLTFNode().

◆ offset

uint32_t mnd::VertexElement::offset

Byte offset from the start of one vertex.

Definition at line 47 of file VertexLayout.h.

Referenced by mnd::ParseGLTFNode().

◆ PositionIndex

constexpr int mnd::VertexElement::PositionIndex = 0
staticconstexpr

Canonical attribute slot indices — must match the GLSL layout locations.

layout(location = 0) vec3 aPosition

Definition at line 51 of file VertexLayout.h.

Referenced by mnd::Mesh::CreateBox(), mnd::Mesh::CreateCapsule(), mnd::Mesh::CreateCube(), mnd::Mesh::CreateSphere(), and mnd::ParseGLTFNode().

◆ size

GLuint mnd::VertexElement::size

Number of components (e.g. 3 for a vec3 position).

Definition at line 45 of file VertexLayout.h.

Referenced by mnd::ParseGLTFNode().

◆ type

GLuint mnd::VertexElement::type

GL data type constant (e.g. GL_FLOAT).

Definition at line 46 of file VertexLayout.h.

Referenced by mnd::ParseGLTFNode().

◆ UVIndex

constexpr int mnd::VertexElement::UVIndex = 2
staticconstexpr

layout(location = 2) vec2 aUV

Definition at line 53 of file VertexLayout.h.

Referenced by mnd::Mesh::CreateBox(), mnd::Mesh::CreateCapsule(), mnd::Mesh::CreateCube(), mnd::Mesh::CreateSphere(), and mnd::ParseGLTFNode().


The documentation for this struct was generated from the following file: