From 1e4d40ad92ac22e7e59ffa3562e519071f4af715 Mon Sep 17 00:00:00 2001 From: rdeioris Date: Tue, 14 Nov 2023 20:00:04 +0100 Subject: [PATCH] quick fix for 5.3 wrong management of TexCoords --- .../glTFRuntime/Private/glTFRuntimeParserStaticMeshes.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/glTFRuntime/Private/glTFRuntimeParserStaticMeshes.cpp b/Source/glTFRuntime/Private/glTFRuntimeParserStaticMeshes.cpp index 7534c7c5..0e392210 100644 --- a/Source/glTFRuntime/Private/glTFRuntimeParserStaticMeshes.cpp +++ b/Source/glTFRuntime/Private/glTFRuntimeParserStaticMeshes.cpp @@ -477,7 +477,13 @@ UStaticMesh* FglTFRuntimeParser::LoadStaticMesh_Internal(TSharedRefbAllowCPUAccess); LODResources.VertexBuffers.StaticMeshVertexBuffer.SetUseFullPrecisionUVs(bHighPrecisionUVs || StaticMeshConfig.bUseHighPrecisionUVs); +#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3 + LODResources.VertexBuffers.StaticMeshVertexBuffer.Init(0, NumUVs, StaticMesh->bAllowCPUAccess); + LODResources.VertexBuffers.StaticMeshVertexBuffer.AppendVertices(StaticMeshBuildVertices.GetData(), StaticMeshBuildVertices.Num()); +#else LODResources.VertexBuffers.StaticMeshVertexBuffer.Init(StaticMeshBuildVertices, NumUVs, StaticMesh->bAllowCPUAccess); +#endif + if (bHasVertexColors) { LODResources.VertexBuffers.ColorVertexBuffer.Init(StaticMeshBuildVertices, StaticMesh->bAllowCPUAccess);