mirror of
				https://github.com/maxartz15/VertexAnimation.git
				synced 2025-11-04 02:15:59 +01:00 
			
		
		
		
	Large mesh support.
This commit is contained in:
		@@ -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();
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user