|
Foundation
|
#include <meshoptimizer.h>#include <clusterlod.h>#include <Math/Quantize.hpp>#include "Mesh.hpp"#include <cmath>Classes | |
| struct | DAGCluster |
Macros | |
| #define | CLUSTERLOD_IMPLEMENTATION |
Functions | |
| void | CoordinateSystem (float3 n, float3 &b1, float3 &b2) |
| float2 | PackUnitOctahedralSnorm (float3 v) |
| float3 | UnpackUnitOctahedralSnorm (float2 v) |
| float | PackUnitCircleSnorm (float2 v) |
| float2 | UnpackUnitCircleSnorm (float v) |
| void | RecomputeNormals (Span< FVertex > verts, Span< const uint32_t > indices) |
| Recomputes smooth per-vertex normals from positions over an indexed triangle list. | |
| template<typename Vertex , typename Index > | |
| void | OptimizeVertexIndex (Vector< Vertex > &vertices, Vector< Index > &indices) |
| template<typename Vertex , typename Index > | |
| float | GenerateLOD (Vector< Index > &outIndices, Span< const Vertex > vertices, Span< const Index > indices, const float lodScale) |
| template<typename Vertex , typename Index > | |
| void | BuildMeshlets (Vector< FMeshlet > &outMeshlet, Vector< Index > &outMeshletVertices, Vector< uint8_t > &outMeshletTriangles, Span< const Vertex > vertices, Span< const Index > indices) |
Variables | |
| constexpr float | EPS = 1e-6 |
| #define CLUSTERLOD_IMPLEMENTATION |
| void BuildMeshlets | ( | Vector< FMeshlet > & | outMeshlet, |
| Vector< Index > & | outMeshletVertices, | ||
| Vector< uint8_t > & | outMeshletTriangles, | ||
| Span< const Vertex > | vertices, | ||
| Span< const Index > | indices | ||
| ) |
| float GenerateLOD | ( | Vector< Index > & | outIndices, |
| Span< const Vertex > | vertices, | ||
| Span< const Index > | indices, | ||
| const float | lodScale | ||
| ) |
| void OptimizeVertexIndex | ( | Vector< Vertex > & | vertices, |
| Vector< Index > & | indices | ||
| ) |
| float PackUnitCircleSnorm | ( | float2 | v | ) |
Recomputes smooth per-vertex normals from positions over an indexed triangle list.
Area-weighted face-normal accumulation, then normalize. Needed after POSITION-only morph deformation (which moves vertices without supplying normals); run it on the morphed vertices before packing/skinning so shading matches the deformed surface. Tangents are left as-is (re-projected onto the new normal frame by FQVertex::PackTBN).
| float2 UnpackUnitCircleSnorm | ( | float | v | ) |
|
constexpr |