kanzi::VertexAttribute Class Reference

A base class for mesh and shader program vertex attributes. More...

#include <kanzi/core.ui/graphics3d/graphics_enums.hpp>

Inheritance diagram for kanzi::VertexAttribute:
kanzi::MeshVertexAttribute kanzi::ShaderVertexAttribute

Public Types

enum  Semantic {
  SemanticPosition, SemanticNormal, SemanticTangent, SemanticTextureCoordinate,
  SemanticColor, SemanticWeight, SemanticMatrixPalette, SemanticCount,
  SemanticCustom, SemanticInvalid
}
 Vertex attribute enumeration for engine. More...
 

Public Member Functions

 VertexAttribute ()
 Constructor. More...
 
 VertexAttribute (string_view name, Semantic semantic, unsigned int semanticIndex)
 Constructor. More...
 

Public Attributes

string name
 Name of the attribute. Not currently used. More...
 
Semantic semantic
 Attribute semantic. More...
 
unsigned int semanticIndex
 Semantic index. More...
 

Friends

void swap (VertexAttribute &attribute1, VertexAttribute &attribute2)
 
bool operator== (const VertexAttribute &attribute1, const VertexAttribute &attribute2)
 Comparison operator. More...
 
bool operator!= (const VertexAttribute &attribute1, const VertexAttribute &attribute2)
 Comparison operator. More...
 

Detailed Description

A base class for mesh and shader program vertex attributes.

Vertex attributes are used in model data (meshes) and material types (shader programs). Draw calls that are sent to graphics device for execution must have, among other things, both mesh and shader program attributes setup properly. VertexAttribute is a base class for MeshVertexAttribute and ShaderVertexAttribute. VertexAttribute contains name, semantic and semantic index. Derived classes MeshVertexAttribute and ShaderVertexAttribute contain additional information that is specific to mesh / shader.

Each mesh has a number of attributes, which are repeated for every vertex. For example, a mesh can have attributes such position, normal and texture coordinate. Meshes provide values for each attribute for each vertex. Shaders consume some or all of the attributes provided by mesh.

Member Enumeration Documentation

Vertex attribute enumeration for engine.

Enumerator
SemanticPosition 

Position.

SemanticNormal 

Normal.

SemanticTangent 

Tangent.

SemanticTextureCoordinate 

Texture coordinate.

SemanticColor 

Color.

SemanticWeight 

Weight for matrix palette.

SemanticMatrixPalette 

Matrix palette.

SemanticCount 

Number of fixed vertex attribute semantics.

SemanticCustom 

Custom attribute semnatic.

SemanticInvalid 

Invalid semantic.

Constructor & Destructor Documentation

kanzi::VertexAttribute::VertexAttribute ( )
inlineexplicit

Constructor.

kanzi::VertexAttribute::VertexAttribute ( string_view  name,
Semantic  semantic,
unsigned int  semanticIndex 
)
inlineexplicit

Constructor.

Parameters
nameName for vertex attribute.
semanticSemantic for vertex attribute.
semanticIndexSemantic index for vertex attribute.

Friends And Related Function Documentation

void swap ( VertexAttribute attribute1,
VertexAttribute attribute2 
)
friend
bool operator== ( const VertexAttribute attribute1,
const VertexAttribute attribute2 
)
friend

Comparison operator.

bool operator!= ( const VertexAttribute attribute1,
const VertexAttribute attribute2 
)
friend

Comparison operator.

Member Data Documentation

string kanzi::VertexAttribute::name

Name of the attribute. Not currently used.

Semantic kanzi::VertexAttribute::semantic

Attribute semantic.

unsigned int kanzi::VertexAttribute::semanticIndex

Semantic index.


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