Add support for up to 4 texture channels when importing meshes

#2667
This commit is contained in:
Wojtek Figat
2025-01-11 22:40:20 +01:00
parent 756ba0a533
commit a1c46d2e6e
31 changed files with 427 additions and 475 deletions

View File

@@ -2027,11 +2027,14 @@ bool ModelTool::ImportModel(const String& path, ModelData& data, Options& option
meshopt_remapVertexBuffer(dstMesh->name.Get(), srcMesh->name.Get(), srcMeshVertexCount, sizeof(type), remap.Get()); \
}
REMAP_VERTEX_BUFFER(Positions, Float3);
REMAP_VERTEX_BUFFER(UVs, Float2);
dstMesh->UVs.Resize(srcMesh->UVs.Count());
for (int32 channelIdx = 0; channelIdx < srcMesh->UVs.Count(); channelIdx++)
{
REMAP_VERTEX_BUFFER(UVs[channelIdx], Float2);
}
REMAP_VERTEX_BUFFER(Normals, Float3);
REMAP_VERTEX_BUFFER(Tangents, Float3);
REMAP_VERTEX_BUFFER(Tangents, Float3);
REMAP_VERTEX_BUFFER(LightmapUVs, Float2);
REMAP_VERTEX_BUFFER(Colors, Color);
REMAP_VERTEX_BUFFER(BlendIndices, Int4);
REMAP_VERTEX_BUFFER(BlendWeights, Float4);