vertexCount
Number of vertices used by the index buffer of this sub-mesh.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Property
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public int vertexCount { readonly get; set; }
Remarks
Together with SubMeshDescriptor.firstVertex, this defines the range of vertices that are possibly used by this sub-mesh. You must set the vertex count so that encompasses the whole range of vertices referenced by the index buffer. For example, if the index buffer contains vertex indices , then the needs to be , while needs to be (100-5+1).
firstVertex+vertexCount5,6,100firstVertex5vertexCount96These values are important for any CPU-based mesh processing, for example dynamic batching or CPU skinning.
The SubMeshDescriptor.bounds, SubMeshDescriptor.firstVertex and SubMeshDescriptor.vertexCount values are calculated automatically by Mesh.SetSubMesh, unless MeshUpdateFlags.DontRecalculateBounds flag is passed.
Additional Resources: SubMeshDescriptor.firstVertex.