46 if (handles[j].isValid()) out.
gap =
true;
54 if (i > 0 && sizes[i] >= sizes[i - 1]) out.
disordered =
true;
55 out.
mesh[i + 1] = standIn;
75 glm::vec3& lo, glm::vec3& hi) {
76 const glm::vec3 padding(std::max(displacement, 0.0f));
The cheaper geometry that may stand in for a MeshRenderer once it is small.
Which representation an object's size on screen asks for.
Arbitrary-geometry 2D mesh renderable (deformed sprites, polygons, water surfaces,...
Geometry that lives on the GPU rather than in a frame.
Central resource management system.
Buffers, the layout that describes them, and the bounds culling reads.
std::vector< glm::mat4 > inverseBind
bool isValid() const
Checks if the handle references a valid resource.
Central manager for GPU resources.
Mesh * getMesh(MeshHandle handle)
The mesh a handle names, or null.
constexpr u8 kMaxStandIns
How many stand-ins a group may declare beyond the renderer's own mesh.
Handle< esengine::Mesh > MeshHandle
Handle to GPU-resident geometry.
void meshLocalBounds(const Mesh &base, const Mesh *coarse, f32 displacement, glm::vec3 &lo, glm::vec3 &hi)
std::uint8_t u8
Unsigned 8-bit integer.
bool gatherLodLevels(resource::ResourceManager &resources, const ecs::LODGroup &group, const Mesh &base, LodLevels &out)
const Mesh * placementCoarseMesh(resource::ResourceManager &resources, const Mesh &base, const ecs::MeshInstances &placements)
float f32
32-bit floating point
const Mesh * mesh[lod::kMaxStandIns+1]
Stand-in geometry chosen by how much of the screen the object covers.
f32 lod1Size
Fraction of the viewport height below which lod1 replaces the MeshRenderer's own mesh....
resource::MeshHandle lod1
Geometry drawn once the object is smaller than lod1Size.
resource::MeshHandle lod3
Geometry drawn once the object is smaller than lod3Size.
f32 cullSize
Fraction of the viewport height below which nothing is drawn at all. 0 disables it,...
resource::MeshHandle lod2
Geometry drawn once the object is smaller than lod2Size.
f32 hysteresis
How much further than a threshold the object must grow before the finer level comes back — 0....
Many placements of the one mesh a MeshRenderer draws, as ONE renderable.
resource::MeshHandle lod1Mesh
The cheaper mesh that stands in past lodDistance; invalid = the mesh itself at every distance....
The screen sizes a group hands over at, in the order it hands them over.
f32 takeOver[kMaxStandIns]