ShaderVertexAttribute describes the attributes that shader program will read when executed by graphics device. More...
#include <kanzi/core.ui/graphics3d/graphics_enums.hpp>
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) |
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.
enum kanzi::ShaderVertexAttribute::FlagBit : unsigned int |
|
explicitdefault |
Constructor.
|
inlineexplicit |
Constructor.
name | Name of vertex attribute. |
semantic | Semantic of vertex attribute. |
semanticIndex | Semantic index of vertex attribute. |
elementType | Element type of vertex attribute. For example, vec3 attribute has float element type. |
rows | Number of rows in vertex attribute. This is only used by matrices. |
columns | Number of columns in vertex attribute. For example, vec3 attribute has 3 columns. |
location | The location where attribute should be bound. |
flags | Flags for vertex attribute. |
|
inline |
Indicates whether attribute is used for morphing.
|
friend |
|
friend |
|
friend |
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.