#pragma once #include #include #include #include namespace fmt { struct AssetResolver; } // W4/R2 —— `.spt` 几何尚未跨平台读取(见 formats/spt.h),运行时使用 tree proxy: // 确定性枝干 + 多组交叉叶簇,并优先采用 .spt 指向的真实 bark/composite DDS。 // 一份共享 mesh / treefile,逐实例只由 MultiMesh 承载原 AreaData 位置。 namespace mtgodot { // species_hint = treefile 名(判针叶/阔叶)。height_m ≈ 期望树高(米)。 godot::Ref build_placeholder_tree(const godot::String &species_hint, float height_m = 12.0f); // R2 tree proxy:保留无专有运行时的限制,但从 .spt 嗅探真实树皮和 composite atlas, // 用确定性的枝干/叶簇 mesh 近似 SpeedTree 的 branch/frond/leaf 分层。结果按 treefile 缓存, // 可安全用于每树种一个 MultiMesh。若资源解析失败,自动退回纯程序化材质。 godot::Ref get_tree_proxy_mesh(const std::string &treefile, const fmt::AssetResolver &resolver, float height_m = 12.0f); // 从 treefile 名猜是否针叶(cedar / cypress / pine / fir / spruce…)。 bool species_is_conifer(const godot::String &species_hint); // 退出时清 shader、DDS 和 treefile->mesh 缓存。 void cleanup_tree_shader(); } // namespace mtgodot