Split mesh artifacts into material and texture artifacts

This commit is contained in:
2026-04-02 19:36:16 +08:00
parent b2d0570b1b
commit e30f5d5ffa
12 changed files with 939 additions and 135 deletions

View File

@@ -51,7 +51,15 @@ LoadResult CreateTextureResource(const Containers::String& path,
}
LoadResult LoadTextureArtifact(const Containers::String& path) {
std::ifstream input(path.CStr(), std::ios::binary);
std::filesystem::path resolvedPath(path.CStr());
if (!resolvedPath.is_absolute() && !std::filesystem::exists(resolvedPath)) {
const Containers::String& resourceRoot = ResourceManager::Get().GetResourceRoot();
if (!resourceRoot.Empty()) {
resolvedPath = std::filesystem::path(resourceRoot.CStr()) / resolvedPath;
}
}
std::ifstream input(resolvedPath, std::ios::binary);
if (!input.is_open()) {
return LoadResult(Containers::String("Failed to read texture artifact: ") + path);
}