vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
lod.h
1#pragma once
2
3#include <vector>
4
5#include "core/reflect.h"
6#include "resource/asset/mesh_asset.h"
7
8namespace Vkm::Engine {
9
13struct LODLevel {
14 MeshHandle mesh;
15 float maxDistance = 0.0f;
16};
17
25struct LOD {
26 std::vector<LODLevel> levels;
27
31 float bias = 1.0f;
32
34 static constexpr float REFERENCE_P11 = 1.7320508f;
35};
36
37} // namespace Vkm::Engine
38
39VKM_REFLECT_BEGIN(::Vkm::Engine::LODLevel)
40 VKM_F(mesh)
41 VKM_F(maxDistance)
42VKM_REFLECT_END()
43
44VKM_REFLECT_BEGIN(::Vkm::Engine::LOD)
45 VKM_F(levels)
46 VKM_F(bias)
47VKM_REFLECT_END()
One detail level: the mesh to draw while the entity is near enough.
Definition lod.h:13
float maxDistance
Used while the camera is within this range.
Definition lod.h:15
Distance-selected geometry for an entity.
Definition lod.h:25
float bias
Scales every level's range; >1 keeps detail longer.
Definition lod.h:31
static constexpr float REFERENCE_P11
projection[1][1] of the 60-degree vertical field of view level ranges are set against.
Definition lod.h:34