mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2024-12-04 17:20:44 +01:00
Large mesh support.
This commit is contained in:
parent
894ddce76e
commit
a8ffefa9d6
@ -211,6 +211,20 @@ namespace TAO.VertexAnimation
|
||||
|
||||
// Actually combine and recalculate mesh.
|
||||
Mesh skinnedMesh = new Mesh();
|
||||
|
||||
// Large mesh support.
|
||||
int vertexCount = 0;
|
||||
foreach (var ci in combineInstances)
|
||||
{
|
||||
vertexCount += ci.mesh.vertexCount;
|
||||
}
|
||||
|
||||
if (vertexCount > 65535)
|
||||
{
|
||||
skinnedMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
|
||||
}
|
||||
|
||||
// Combine meshes.
|
||||
skinnedMesh.CombineMeshes(combineInstances.ToArray(), true, true);
|
||||
skinnedMesh.RecalculateBounds();
|
||||
|
||||
|
@ -261,7 +261,13 @@ namespace TAO.VertexAnimation
|
||||
tris.Add(t * 3 + v - skipped);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Large mesh support.
|
||||
if (vertices.Count > 65535)
|
||||
{
|
||||
mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
|
||||
}
|
||||
|
||||
mesh.vertices = vertices.ToArray();
|
||||
mesh.normals = normals.ToArray();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user