Kanzi 3.9.10
kanzi::VertexAttribute Class Reference

Base class for the vertex and instance attributes of mesh and shader program. More...

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

Inheritance diagram for kanzi::VertexAttribute:
[legend]

Public Types

enum  Semantic {
  SemanticPosition , SemanticNormal , SemanticTangent , SemanticTextureCoordinate ,
  SemanticColor , SemanticWeight , SemanticMatrixPalette , SemanticBitangent ,
  SemanticCount , SemanticCustom , SemanticInvalid
}
 Specifies the available vertex attributes. More...
 

Public Member Functions

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

Public Attributes

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

Friends

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

Detailed Description

Base class for the vertex and instance attributes of mesh and shader program.

Kanzi uses vertex attributes in model data (meshes) and material types (shader programs). The draw calls that Kanzi sends to a graphics device for execution must have both mesh and shader program attributes set up properly. VertexAttribute is a base class for MeshVertexAttribute and ShaderVertexAttribute. VertexAttribute contains a name, a semantic, and a semantic index. The derived classes MeshVertexAttribute and ShaderVertexAttribute contain additional information that is specific to the mesh or shader.

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

Member Enumeration Documentation

◆ Semantic

Specifies the available vertex attributes.

Enumerator
SemanticPosition 

Position.

SemanticNormal 

Normal.

SemanticTangent 

Tangent.

SemanticTextureCoordinate 

Texture coordinate.

SemanticColor 

Color.

SemanticWeight 

Weight for matrix palette.

SemanticMatrixPalette 

Matrix palette.

SemanticBitangent 

Bitangent.

This semantic is also often called "Binormal". The nomenclature is interchangeable.

SemanticCount 

Number of fixed vertex attribute semantics.

SemanticCustom 

Custom attribute semantic.

SemanticInvalid 

Invalid semantic.

Constructor & Destructor Documentation

◆ VertexAttribute() [1/2]

kanzi::VertexAttribute::VertexAttribute ( )
explicitdefault

Constructor.

◆ VertexAttribute() [2/2]

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 Symbol Documentation

◆ swap

void swap ( VertexAttribute & attribute1,
VertexAttribute & attribute2 )
friend

◆ operator==

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

Comparison operator.

◆ operator!=

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

Comparison operator.

Member Data Documentation

◆ name

string kanzi::VertexAttribute::name

Name of the attribute. Not currently used.

◆ semantic

Semantic kanzi::VertexAttribute::semantic

Attribute semantic.

◆ semanticIndex

unsigned int kanzi::VertexAttribute::semanticIndex

Semantic index.


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