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

@@ -132,7 +132,10 @@ void RepackMeshLightmapUVs(ModelData& data)
{
Float2 uvOffset(entry.Slot->X * atlasSizeInv, entry.Slot->Y * atlasSizeInv);
Float2 uvScale(entry.Slot->Width * atlasSizeInv, entry.Slot->Height * atlasSizeInv);
for (auto& uv : entry.Mesh->LightmapUVs)
if (entry.Mesh->LightmapUVsIndex == -1)
continue;
auto& lightmapUVs = entry.Mesh->UVs[entry.Mesh->LightmapUVsIndex];
for (auto& uv : lightmapUVs)
{
uv = uv * uvScale + uvOffset;
}