This class provides a description of vertex data format used during rendering.
More...
#include <Luminous/VertexDescription.hpp>
This class provides a description of vertex data format used during rendering.
Vertex description maps the named vertex components (vertex attributes) used in shaders to data contained in vertex buffers.
- Examples:
- AdvancedRenderingExample.cpp, PostProcessingExample.cpp, and Widget3DExample.cpp.
template<typename AttrType >
| void Luminous::VertexDescription::addAttribute |
( |
const QString & |
attrName | ) |
|
template<typename AttrType >
| void Luminous::VertexDescription::addAttribute |
( |
const QString & |
attrName, |
|
|
uint |
offset |
|
) |
| |
Add an attribute at specific offset.
- Parameters
-
| attrName | Vertex attribute name |
| offset | Offset in bytes from the start of the vertex |
- Template Parameters
-
| AttrType | Type of the vertex attribute |
| LUMINOUS_API VertexAttribute Luminous::VertexDescription::attribute |
( |
size_t |
index | ) |
const |
Returns the requested attribute.
- Parameters
-
| index | index of the vertex attribute |
- Returns
- copy of the requested vertex attribute
| LUMINOUS_API size_t Luminous::VertexDescription::attributeCount |
( |
| ) |
const |
Returns the number of attributes in this description.
- Returns
- number of attributes
| LUMINOUS_API const VertexAttribute* Luminous::VertexDescription::findAttribute |
( |
const QString & |
attrName | ) |
const |
Find a named attribute.
- Parameters
-
| attrName | Vertex attribute name |
- Returns
- vertex Attribute if the attribute is found; otherwise nullptr
| LUMINOUS_API void Luminous::VertexDescription::removeAttribute |
( |
const QString & |
attrName | ) |
|
Remove a named attribute.
- Parameters
-
| attrName | Vertex attribute name to be removed |
| LUMINOUS_API uint Luminous::VertexDescription::vertexSize |
( |
| ) |
const |
Returns the total size of a vertex.
- Returns
- vertex size in bytes