Formalize renderer material contracts and harden backpack import

This commit is contained in:
2026-04-08 04:27:21 +08:00
parent 7be3b2cc45
commit 6113ed92b0
18 changed files with 534 additions and 326 deletions

View File

@@ -62,6 +62,18 @@ std::filesystem::path ResolveRuntimePath(const char* relativePath) {
return GetExecutableDirectory() / relativePath;
}
void NormalizeBackpackTestMaterials(Mesh& mesh) {
for (Material* material : mesh.GetMaterials()) {
if (material == nullptr) {
continue;
}
MaterialRenderState renderState = material->GetRenderState();
renderState.cullMode = MaterialCullMode::None;
material->SetRenderState(renderState);
}
}
const char* GetScreenshotFilename(RHIType backendType) {
switch (backendType) {
case RHIType::D3D12:
@@ -179,6 +191,7 @@ void BackpackSceneTest::LoadBackpackMesh() {
ASSERT_TRUE(mMesh->IsValid());
ASSERT_GT(mMesh->GetVertexCount(), 0u);
ASSERT_GT(mMesh->GetSections().Size(), 0u);
NormalizeBackpackTestMaterials(*mMesh);
}
void BackpackSceneTest::BuildScene() {