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. | |
ShaderVertexAttribute ()=default | |
Constructor. | |
ShaderVertexAttribute (string_view name, Semantic semantic, unsigned int semanticIndex, GraphicsElementType elementType, unsigned int rows, unsigned int columns, int location, unsigned int flags) | |
Constructor. | |
Public Member Functions inherited from kanzi::VertexAttribute | |
VertexAttribute ()=default | |
Constructor. | |
VertexAttribute (string_view name, Semantic semantic, unsigned int semanticIndex) | |
Constructor. | |
Public Attributes | |
unsigned int | columns |
Number of columns in vertex attribute. For example, vec3 attribute has 3 columns. | |
GraphicsElementType | elementType |
Element type of vertex attribute./. | |
unsigned int | flags |
Flags for vertex attribute. | |
int | location |
Location that is assigned for the attribute. | |
unsigned int | rows |
Number of rows in vertex attribute. This is only used by matrices. | |
Public Attributes inherited from kanzi::VertexAttribute | |
string | name |
Name of the attribute. Not currently used. | |
Semantic | semantic |
Attribute semantic. | |
unsigned int | semanticIndex |
Semantic index. | |
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.
|
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./.
Number of rows in vertex attribute. This is only used by matrices.
Number of columns in vertex attribute. For example, vec3 attribute has 3 columns.
int kanzi::ShaderVertexAttribute::location |
Location that is assigned for the attribute.