Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::ShaderVertexAttribute Class Reference

ShaderVertexAttribute describes the attributes that shader program will read when executed by graphics device. More...

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

Inheritance diagram for kanzi::ShaderVertexAttribute:
[legend]

Public Types

enum  FlagBit : unsigned int { FlagBitMorph }
 Flags for shader attribute. More...
 
- Public Types inherited from kanzi::VertexAttribute
enum  Semantic {
  SemanticPosition, SemanticNormal, SemanticTangent, SemanticTextureCoordinate,
  SemanticColor, SemanticWeight, SemanticMatrixPalette, SemanticBitangent,
  SemanticCount, SemanticCustom, SemanticInvalid
}
 Specifies the available vertex attributes. More...
 

Public Member Functions

bool isMorph () const
 Indicates whether attribute is used for morphing. More...
 
 ShaderVertexAttribute ()=default
 Constructor. More...
 
 ShaderVertexAttribute (string_view name, Semantic semantic, unsigned int semanticIndex, GraphicsElementType elementType, unsigned int rows, unsigned int columns, int location, unsigned int flags)
 Constructor. More...
 
- Public Member Functions inherited from kanzi::VertexAttribute
 VertexAttribute ()=default
 Constructor. More...
 
 VertexAttribute (string_view name, Semantic semantic, unsigned int semanticIndex)
 Constructor. More...
 

Public Attributes

unsigned int columns
 Number of columns in vertex attribute. For example, vec3 attribute has 3 columns. More...
 
GraphicsElementType elementType
 Element type of vertex attribute./. More...
 
unsigned int flags
 Flags for vertex attribute. More...
 
int location
 Location that is assigned for the attribute. More...
 
unsigned int rows
 Number of rows in vertex attribute. This is only used by matrices. More...
 
- Public Attributes inherited from kanzi::VertexAttribute
string name
 Name of the attribute. Not currently used. More...
 
Semantic semantic
 Attribute semantic. More...
 
unsigned int semanticIndex
 Semantic index. More...
 

Friends

bool operator!= (const ShaderVertexAttribute &attribute1, const ShaderVertexAttribute &attribute2)
 
bool operator== (const ShaderVertexAttribute &attribute1, const ShaderVertexAttribute &attribute2)
 
void swap (ShaderVertexAttribute &attribute1, ShaderVertexAttribute &attribute2)
 

Detailed Description

ShaderVertexAttribute describes the attributes that shader program will read when executed by graphics device.

Shader vertex attributes have assigned location. Graphics devices have a limited number of locations (For example, OpenGL ES 2 has 8 attribute locations available, and OpenGL ES 3 has 16). Within a shader program, each attribute must be assigned to unique location.

Shader vertex attributes also have element type, rows and columns. These indicate what kind of data shader program is reading, and how many elements. The mesh vertex data may be stored in different format in memory. Together with mesh vertex attribute data type and shader vertex attribute element type, the graphics device sets up any necessary conversions.

Member Enumeration Documentation

Flags for shader attribute.

Enumerator
FlagBitMorph 

Flag to indicate that attribute is used in morphing.

Constructor & Destructor Documentation

kanzi::ShaderVertexAttribute::ShaderVertexAttribute ( )
explicitdefault

Constructor.

kanzi::ShaderVertexAttribute::ShaderVertexAttribute ( string_view  name,
Semantic  semantic,
unsigned int  semanticIndex,
GraphicsElementType  elementType,
unsigned int  rows,
unsigned int  columns,
int  location,
unsigned int  flags 
)
inlineexplicit

Constructor.

Parameters
nameName of vertex attribute.
semanticSemantic of vertex attribute.
semanticIndexSemantic index of vertex attribute.
elementTypeElement type of vertex attribute. For example, vec3 attribute has float element type.
rowsNumber of rows in vertex attribute. This is only used by matrices.
columnsNumber of columns in vertex attribute. For example, vec3 attribute has 3 columns.
locationThe location where attribute should be bound.
flagsFlags for vertex attribute.

Member Function Documentation

bool kanzi::ShaderVertexAttribute::isMorph ( ) const
inline

Indicates whether attribute is used for morphing.

Friends And Related Function Documentation

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

Member Data Documentation

GraphicsElementType kanzi::ShaderVertexAttribute::elementType

Element type of vertex attribute./.

unsigned int kanzi::ShaderVertexAttribute::rows

Number of rows in vertex attribute. This is only used by matrices.

unsigned int kanzi::ShaderVertexAttribute::columns

Number of columns in vertex attribute. For example, vec3 attribute has 3 columns.

int kanzi::ShaderVertexAttribute::location

Location that is assigned for the attribute.

unsigned int kanzi::ShaderVertexAttribute::flags

Flags for vertex attribute.


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