60 const std::vector<Vertex>& vertices,
61 const std::vector<uint32_t>& indices,
62 const std::vector<meshopt_Meshlet>& baseMeshlets,
63 const std::vector<uint32_t>& baseMeshletVertices,
64 const std::vector<uint8_t>& baseMeshletTriangles,
83 const std::vector<Vertex>& srcVertices,
84 const std::vector<uint32_t>& srcIndices,
85 size_t targetIndexCount,
87 size_t maxVerticesPerMeshlet,
88 size_t maxTrianglesPerMeshlet
95 const std::vector<Vertex>& vertices,
96 const std::vector<uint32_t>& indices
103 const std::vector<Vertex>& vertices,
104 const meshopt_Meshlet& meshlet,
105 const std::vector<uint32_t>& meshletVertices
Generates LOD hierarchy for meshes using meshoptimizer.
static glm::vec4 computeMeshletBoundingSphere(const std::vector< Vertex > &vertices, const meshopt_Meshlet &meshlet, const std::vector< uint32_t > &meshletVertices)
Compute bounding sphere for a meshlet.
static LodLevelData generateLodLevel(const std::vector< Vertex > &srcVertices, const std::vector< uint32_t > &srcIndices, size_t targetIndexCount, float targetError, size_t maxVerticesPerMeshlet, size_t maxTrianglesPerMeshlet)
static Ecs::LodHierarchyResult generate(const std::vector< Vertex > &vertices, const std::vector< uint32_t > &indices, const std::vector< meshopt_Meshlet > &baseMeshlets, const std::vector< uint32_t > &baseMeshletVertices, const std::vector< uint8_t > &baseMeshletTriangles, const LodGenerationConfig &config={})
Generate LOD hierarchy from mesh geometry.
static glm::vec4 computeBoundingSphere(const std::vector< Vertex > &vertices, const std::vector< uint32_t > &indices)
Compute bounding sphere for a set of vertices.
Log category system implementation.
Result of LOD hierarchy generation for a mesh primitive. Contains per-cluster and per-group data for ...
Generate a single LOD level by simplifying geometry.
std::vector< uint8_t > meshletTriangles
std::vector< Vertex > vertices
std::vector< meshopt_Meshlet > meshlets
std::vector< uint32_t > indices
std::vector< uint32_t > meshletVertices
float error
Simplification error for this level.
Configuration for LOD hierarchy generation.
size_t maxTrianglesPerCluster
Max triangles per cluster/meshlet.
float simplificationRatio
Reduction ratio per LOD level (0.5 = halve each level)
size_t minTrianglesForLod
Minimum triangles to consider LOD generation.
size_t maxLodLevels
Maximum LOD levels to generate.
float targetError
Target simplification error.