Add Nahida model import and preview pipeline

This commit is contained in:
2026-04-11 20:16:49 +08:00
parent 8f71f99de4
commit 030230eb1f
87 changed files with 7245 additions and 117 deletions

View File

@@ -185,7 +185,7 @@ void DumpMeshDiagnostics(const char* label, const Mesh* mesh) {
const StaticMeshVertex& firstVertex = vertices[0];
std::printf(
"[NahidaDiag] %s firstVertex pos=(%.4f, %.4f, %.4f) normal=(%.4f, %.4f, %.4f) tangent=(%.4f, %.4f, %.4f) bitangent=(%.4f, %.4f, %.4f) uv=(%.4f, %.4f)\n",
"[NahidaDiag] %s firstVertex pos=(%.4f, %.4f, %.4f) normal=(%.4f, %.4f, %.4f) tangent=(%.4f, %.4f, %.4f) bitangent=(%.4f, %.4f, %.4f) uv0=(%.4f, %.4f) uv1=(%.4f, %.4f) color=(%.4f, %.4f, %.4f, %.4f)\n",
label,
firstVertex.position.x,
firstVertex.position.y,
@@ -200,7 +200,13 @@ void DumpMeshDiagnostics(const char* label, const Mesh* mesh) {
firstVertex.bitangent.y,
firstVertex.bitangent.z,
firstVertex.uv0.x,
firstVertex.uv0.y);
firstVertex.uv0.y,
firstVertex.uv1.x,
firstVertex.uv1.y,
firstVertex.color.x,
firstVertex.color.y,
firstVertex.color.z,
firstVertex.color.w);
std::printf(
"[NahidaDiag] %s uvRange min=(%.4f, %.4f) max=(%.4f, %.4f)\n",
label,
@@ -356,6 +362,16 @@ void NahidaPreviewSceneTest::SetUp() {
ASSERT_NE(m_scene->Find("Face"), nullptr);
PreloadSceneResources();
auto* bodyMeshObject = m_scene->Find("Body_Mesh0");
ASSERT_NE(bodyMeshObject, nullptr);
auto* bodyMeshFilter = bodyMeshObject->GetComponent<MeshFilterComponent>();
ASSERT_NE(bodyMeshFilter, nullptr);
Mesh* bodyMesh = bodyMeshFilter->GetMesh();
ASSERT_NE(bodyMesh, nullptr);
EXPECT_TRUE(HasVertexAttribute(bodyMesh->GetVertexAttributes(), VertexAttribute::Color));
EXPECT_TRUE(HasVertexAttribute(bodyMesh->GetVertexAttributes(), VertexAttribute::UV1));
ApplyIsolationFilter();
ApplyDiagnosticOverrides();
DumpTargetDiagnostics();