struct
#include <engine/render/mesh/vertex.hpp>
RenderMeshVertex Vertex data type stored in the RenderMeshPool's vertex buffer.
Public static functions
-
static auto addVertexElements(const char* position,
const char* normal,
const char* material,
std::size_t bufferIndex,
core::
gl:: VertexArrayDesc& desc) -> bool - Generates a vertex element description for this vertex type.
- static void generate(const VoxelGrid& grid, std::vector<RenderMeshVertex>& vertices)
- Generates a vertex mesh for the given voxel grid.
Public variables
Function documentation
static bool cubos:: engine:: RenderMeshVertex:: addVertexElements(const char* position,
const char* normal,
const char* material,
std::size_t bufferIndex,
core:: gl:: VertexArrayDesc& desc)
Generates a vertex element description for this vertex type.
Parameters | |
---|---|
position | Position attribute name in the pipeline. |
normal | Normal attribute name in the pipeline. |
material | Material attribute name in the pipeline. |
bufferIndex | Index of the vertex buffer where the elements will be stored. |
desc | Vertex array description to add the elements to. |
Returns | Whether the vertex elements fitted in the vertex array description. |
Assumes a vertex buffer stores this and only this type, as an array of ivec2, where the x component is the positionAndSize, and the colorAndNormal is the y component.
static void cubos:: engine:: RenderMeshVertex:: generate(const VoxelGrid& grid,
std::vector<RenderMeshVertex>& vertices)
Generates a vertex mesh for the given voxel grid.
Parameters | |
---|---|
grid | Voxel grid. |
vertices out | Vertices generated from the voxel grid. |