载入中...
搜索中...
未找到
VirtualGeometryAsset.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <vector>
5
6namespace eve::virtualgeometry {
7
18 std::uint32_t u0[4];
19 std::uint32_t u1[4];
20 std::uint32_t u2[4];
21 std::uint32_t u3[4];
22};
23
25struct VgCluster {
26 float cx = 0.f, cy = 0.f, cz = 0.f, r = 0.f; // bounding sphere
27 std::uint32_t triStart = 0, triCount = 0; // global triangle stream range
28 std::uint32_t vertStart = 0, vertCount = 0; // global position range used
29 std::uint32_t lodLevel = 0;
30 float errorR = 0.f; // world-space geometric error radius
31 float errorRScreen = 0.f; // screen-space error constant (precomputed)
32 std::uint32_t parent = 0xFFFFFFFFu; // 0xFFFFFFFF = root
33 std::uint32_t children[4] = {0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu};
34 std::uint32_t childCount = 0;
35};
36
42 int vertexCount = 0;
43 std::vector<float> positions; // xyz packed, size = 3 * vertexCount
44 std::vector<float> normals; // optional xyz packed
45
47 std::vector<std::uint32_t> triangles;
48
49 std::vector<VgCluster> clusters;
50
51 // Precomputed projection-dependent constant cache (recomputed on setCamera).
52 float lastErrorScale = 1.f;
53
54 int totalTriangles() const { return static_cast<int>(triangles.size() / 3); }
55};
56
57} // namespace eve::virtualgeometry
CPU-side processed cluster (before packing into VgGpuCluster).
GPU-mirrored cluster node layout (std430, matches shaders/vg_*.comp). Exactly 4 x uvec4 per cluster:
Fully processed virtual-geometry asset (CPU representation). Produced by Builder from a Mesh; uploade...
std::vector< std::uint32_t > triangles
Flat global triangle stream; each entry is an index into positions.