mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2024-12-05 01:30: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();
|
||||
|
||||
|
@ -262,6 +262,12 @@ namespace TAO.VertexAnimation
|
||||
}
|
||||
}
|
||||
|
||||
// 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