Foundation
Loading...
Searching...
No Matches
Mesh.hpp
Go to the documentation of this file.
1#pragma once
2#include <Math/Math.hpp>
3#include <Core/Core.hpp>
4#include <Assets/Mesh.hpp>
6namespace ModelViewer
7{
8 using namespace Foundation::Core;
9 using namespace Foundation::Math;
10 using namespace Foundation::Rendering;
11 constexpr int kMaxSceneMeshLodCount = 4;
12 // Intermediate scratch buffers
13 // TODO: We may want to actually cache these. Meshlet generation can be expensive.
29#pragma pack(push, 4)
59#pragma pack(pop)
60}
General Purpose Allocator (GPA) interface.
Definition Allocator.hpp:24
Allocators, Data Structures and introspection implementations.
Definition Allocator.hpp:5
std::unique_ptr< T, StlDeleter< T > > UniquePtr
std::unique_ptr with custom deleter that uses a Foundation::Core::Allocator to deallocate memory.
Definition Allocator.hpp:161
Mathematical utilities and types.
Definition Math.hpp:21
Reference implementations of real-time rendering routines.
Definition Application.hpp:18
uint32_t VirtualAllocation
Definition VirtualAllocator.hpp:9
constexpr VirtualAllocation kInvalidVirtualAllocation
Definition VirtualAllocator.hpp:11
ModelViewer implementation.
Definition App.cpp:17
constexpr int kMaxSceneMeshLodCount
Definition Mesh.hpp:11
MeshScratchBuffers sceneMeshDataFromVertexIndex(Span< MeshVertex > vertices, Span< MeshIndex > indices, Allocator *allocator, int numLods=kMaxSceneMeshLodCount, bool buildMeshlets=true)
Definition Scene.cpp:4
Definition Mesh.hpp:49
VirtualAllocation self
Definition Mesh.hpp:56
uint32_t vertexRawOffset
Definition Mesh.hpp:52
VirtualAllocation vertices
Definition Mesh.hpp:50
uint32_t selfRawOffset
Definition Mesh.hpp:57
uint32_t vertexCount
Definition Mesh.hpp:51
MeshLodAllocation lods[kMaxSceneMeshLodCount]
Definition Mesh.hpp:54
uint32_t lodCount
Definition Mesh.hpp:53
Definition Mesh.hpp:31
uint32_t meshletVerticesRawOffset
Definition Mesh.hpp:41
uint32_t meshletTrianglesRawOffset
Definition Mesh.hpp:42
uint32_t meshletRawOffset
Definition Mesh.hpp:40
VirtualAllocation meshletTriangles
Definition Mesh.hpp:35
uint32_t meshletCount
Definition Mesh.hpp:37
VirtualAllocation meshlets
Definition Mesh.hpp:33
VirtualAllocation indices
Definition Mesh.hpp:32
uint32_t indexCount
Definition Mesh.hpp:36
VirtualAllocation meshletVertices
Definition Mesh.hpp:34
uint32_t indexRawOffset
Definition Mesh.hpp:39
Vector< MeshMeshlet > meshlets
Definition Mesh.hpp:17
Vector< MeshIndex > indices
Definition Mesh.hpp:16
MeshLodScratchBuffers(Allocator *allocator)
Definition Mesh.hpp:20
Vector< MeshIndex > meshletVertices
Definition Mesh.hpp:18
Vector< MeshMicroIndex > meshletTriangles
Definition Mesh.hpp:19
Definition Mesh.hpp:23
Vector< MeshLodScratchBuffers > lods
Definition Mesh.hpp:25
MeshScratchBuffers(Allocator *allocator)
Definition Mesh.hpp:26
Vector< MeshVertexCompact > vertices
Definition Mesh.hpp:24