From 99902346573e366d2224b23eb7a66c8566c18fdf Mon Sep 17 00:00:00 2001 From: Emil <65846814+emil28092005@users.noreply.github.com> Date: Wed, 23 Sep 2026 23:11:42 +0300 Subject: [PATCH] Show both prepared LOD levels in renderer example --- docs/manual/editor/visibility-lod.md | 2 ++ examples/renderer/p2_visibility.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/manual/editor/visibility-lod.md b/docs/manual/editor/visibility-lod.md index b5204f3..730137d 100644 --- a/docs/manual/editor/visibility-lod.md +++ b/docs/manual/editor/visibility-lod.md @@ -51,6 +51,8 @@ build/linux-debug/faset_p2_visibility_example direct /tmp/p2-direct.ppm The example creates a fine cube and a prepared coarse tetrahedron in [`examples/renderer/p2_visibility.cpp`](https://github.com/emil28092005/Faset_Engine/blob/main/examples/renderer/p2_visibility.cpp). +Its near object selects LOD 0 and the eight smaller objects select LOD 1; +the program prints those counts and reports Vulkan validation errors. Imported GLB geometry can be supplied as prepared levels by C++ integration, but automatic LOD generation and assigning a GLB's alternate meshes as LODs in the Inspector are not implemented yet. diff --git a/examples/renderer/p2_visibility.cpp b/examples/renderer/p2_visibility.cpp index 71997f2..d05ac04 100644 --- a/examples/renderer/p2_visibility.cpp +++ b/examples/renderer/p2_visibility.cpp @@ -61,7 +61,10 @@ int main(int argc, char** argv) { item.mesh = cube_mesh(); item.lod_meshes = {prepared_coarse}; item.instance_key = "example/cube/" + std::to_string(i); - item.model = transform({float(i - 4) * 1.8f, 0, i % 2 ? -5.f : 0.f}); + const bool near_detail = i == 2; + item.model = transform({float(i - 4) * 1.8f, 0, + near_detail ? 6.f : (i % 2 ? -5.f : 0.f)}, + {}, near_detail ? Vec3{4, 4, 4} : Vec3{1, 1, 1}); item.color = {0.28f + .07f * i, .6f, .8f, 1}; item.cast_shadow = false; frame.draws.push_back(std::move(item));