libdonut  2.3.2
Application framework for cross-platform game development in C++20
Classes | Public Types | Public Attributes | Static Public Attributes | List of all members
donut::graphics::Model::Object Struct Reference

A single 3D mesh with an associated material. More...

#include <donut/graphics/Model.hpp>

Classes

struct  Instance
 Data layout for the attributes of a single instance of the mesh. More...
 
struct  Material
 Material attributes of the mesh. More...
 
struct  Vertex
 Data layout for the attributes of a single vertex of the mesh. More...
 

Public Types

using Index = u32
 Data type used in the index buffer of the mesh. More...
 

Public Attributes

Mesh< Vertex, Index, Instancemesh
 Mesh data stored on the GPU. More...
 
Material material
 Material attributes. More...
 
std::size_t indexCount
 Number of indices stored in the index buffer of the mesh. More...
 

Static Public Attributes

static constexpr MeshBufferUsage VERTICES_USAGE = MeshBufferUsage::STATIC_DRAW
 Hint regarding the intended memory access pattern of the vertex buffer. More...
 
static constexpr MeshBufferUsage INDICES_USAGE = MeshBufferUsage::STATIC_DRAW
 Hint regarding the intended memory access pattern of the index buffer. More...
 
static constexpr MeshBufferUsage INSTANCES_USAGE = MeshBufferUsage::STREAM_DRAW
 Hint regarding the intended memory access pattern of the instance buffer. More...
 
static constexpr MeshPrimitiveType PRIMITIVE_TYPE = MeshPrimitiveType::TRIANGLES
 The type of 3D primitives represented by the mesh vertices. More...
 
static constexpr MeshIndexType INDEX_TYPE = MeshIndexType::U32
 Index type of the mesh indices. More...
 
static constexpr std::int32_t TEXTURE_UNIT_DIFFUSE = 0
 Texture unit index to use for the Material::diffuseMap. More...
 
static constexpr std::int32_t TEXTURE_UNIT_SPECULAR = 1
 Texture unit index to use for the Material::specularMap. More...
 
static constexpr std::int32_t TEXTURE_UNIT_NORMAL = 2
 Texture unit index to use for the Material::normalMap. More...
 
static constexpr std::int32_t TEXTURE_UNIT_EMISSIVE = 3
 Texture unit index to use for the Material::emissiveMap. More...
 
static constexpr std::int32_t TEXTURE_UNIT_COUNT = 4
 Total number of texture units required to render an object. More...
 

Detailed Description

A single 3D mesh with an associated material.

The vertices and indices of the mesh are stored on the GPU, together with an associated instance buffer set up for instanced rendering.

Member Typedef Documentation

◆ Index

Data type used in the index buffer of the mesh.

Note
Meets the requirements of the donut::graphics::mesh_index concept.

Member Data Documentation

◆ VERTICES_USAGE

constexpr MeshBufferUsage donut::graphics::Model::Object::VERTICES_USAGE = MeshBufferUsage::STATIC_DRAW
staticconstexpr

Hint regarding the intended memory access pattern of the vertex buffer.

◆ INDICES_USAGE

constexpr MeshBufferUsage donut::graphics::Model::Object::INDICES_USAGE = MeshBufferUsage::STATIC_DRAW
staticconstexpr

Hint regarding the intended memory access pattern of the index buffer.

◆ INSTANCES_USAGE

constexpr MeshBufferUsage donut::graphics::Model::Object::INSTANCES_USAGE = MeshBufferUsage::STREAM_DRAW
staticconstexpr

Hint regarding the intended memory access pattern of the instance buffer.

◆ PRIMITIVE_TYPE

constexpr MeshPrimitiveType donut::graphics::Model::Object::PRIMITIVE_TYPE = MeshPrimitiveType::TRIANGLES
staticconstexpr

The type of 3D primitives represented by the mesh vertices.

◆ INDEX_TYPE

constexpr MeshIndexType donut::graphics::Model::Object::INDEX_TYPE = MeshIndexType::U32
staticconstexpr

Index type of the mesh indices.

◆ TEXTURE_UNIT_DIFFUSE

constexpr std::int32_t donut::graphics::Model::Object::TEXTURE_UNIT_DIFFUSE = 0
staticconstexpr

Texture unit index to use for the Material::diffuseMap.

◆ TEXTURE_UNIT_SPECULAR

constexpr std::int32_t donut::graphics::Model::Object::TEXTURE_UNIT_SPECULAR = 1
staticconstexpr

Texture unit index to use for the Material::specularMap.

◆ TEXTURE_UNIT_NORMAL

constexpr std::int32_t donut::graphics::Model::Object::TEXTURE_UNIT_NORMAL = 2
staticconstexpr

Texture unit index to use for the Material::normalMap.

◆ TEXTURE_UNIT_EMISSIVE

constexpr std::int32_t donut::graphics::Model::Object::TEXTURE_UNIT_EMISSIVE = 3
staticconstexpr

Texture unit index to use for the Material::emissiveMap.

◆ TEXTURE_UNIT_COUNT

constexpr std::int32_t donut::graphics::Model::Object::TEXTURE_UNIT_COUNT = 4
staticconstexpr

Total number of texture units required to render an object.

◆ mesh

Mesh<Vertex, Index, Instance> donut::graphics::Model::Object::mesh

Mesh data stored on the GPU.

◆ material

Material donut::graphics::Model::Object::material

Material attributes.

◆ indexCount

std::size_t donut::graphics::Model::Object::indexCount

Number of indices stored in the index buffer of the mesh.


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