载入中...
搜索中...
未找到
Builder.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6
7#include <cstdint>
8
9namespace eve::virtualgeometry {
10
24public:
26 struct MeshInput {
27 int vertexCount = 0;
28 const float *positions = nullptr; // xyz packed
29 const float *normals = nullptr; // optional xyz packed
30 const std::uint32_t *indices = nullptr; // triangle list (count % 3 == 0)
31 int indexCount = 0;
32 };
33
34 struct Options {
35 int maxVerticesPerCluster = 64; // ~Nanite 128 tris / 64-96 verts
36 int maxTrianglesPerCluster = 124;
37 int minLodLevels = 4; // build at least this many levels
38 int mergeFactor = 4; // clusters merged into one parent
39 float lodTargetRatio = 0.5f; // parent keeps this fraction of triangles
40 };
41
43 bool build(const MeshInput &in, const Options &opt, VirtualGeometryAsset &out);
44};
45
46} // namespace eve::virtualgeometry
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::uint32_t vertexCount
std::uint32_t indexCount
std::vector< std::uint32_t > indices
std::vector< float > normals
std::vector< float > positions
CPU preprocessor that builds a Nanite-style hierarchical cluster DAG from a triangle mesh:
Definition Builder.h:23
Fully processed virtual-geometry asset (CPU representation). Produced by Builder from a Mesh; uploade...