Introduce stable render instances and prepared LOD policy

This commit is contained in:
Emil
2026-09-23 22:15:15 +03:00
parent 66f59f4afa
commit f8cd73b95f
8 changed files with 460 additions and 15 deletions
+8
View File
@@ -39,6 +39,11 @@ struct DrawItem {
float metallic{0.0f};
bool cast_shadow{true};
std::shared_ptr<const Texture> texture{};
// Empty means an ad-hoc draw without temporal visibility state. Scene extraction
// derives this from persistent object and primitive identities, not draw order.
std::string instance_key{};
// Optional prepared coarser meshes: element zero is LOD 1; mesh is LOD 0.
std::vector<std::shared_ptr<const Mesh>> lod_meshes{};
};
struct Sprite {
Vec3 position{};
@@ -88,6 +93,9 @@ struct Snapshot {
std::vector<Quad> ui_quads;
std::vector<Text> ui_text;
std::vector<UiTriangles> ui_triangles;
// Distinguishes temporal histories when one Renderer displays different views.
std::string view_id{};
bool camera_cut{};
};
// CPU-only validation used before publishing a game or creating Vulkan pipelines.
void validate_shader_bundle(const std::filesystem::path& directory);