- Home /
Combine (skinned) submeshes causes increased vertcount(for each submesh the whole vertcount)
I have a skinned mesh made up of 5 meshes. Two of them have submeshes. After combining them to one mesh. The vertcount is increased by the number of submeshes of each mesh.
Simple example: First mesh has 10 verts(for simplicity). Second mesh has 5 verts, but also 2 submeshes. Combining these should make an overall vertcount of 15 verts. But it's 10+5+(5x2) So each submesh increases my vertcount by the whole(!) vertices count of the whole mesh part. It's easy to hit thr 65k limit, which I never would exceed without that,...bug? Also this might be a performance issue aswell.
I add each submesh to the combineinstances list and combine them via sharedMesh.CombineMeshes... array. The tris count is correct. If I reach 65k+ verts, unity throws an error, of course. So The vertcount is no display-error
edit: I don't mean the stats info, but the actual vertcount you get by double-clicking the mesh in the inspector.
edit2: I used print(smr.sharedMesh.vertexCount) and as I thought, it throws always the vertcount from the whole mesh, for each submesh. If that info is helping someone to find a solution for this.
edit3: it seems each combineinstance of the submeshes containing the all the verts for the mesh + submeshes. If I only add the first combineinstance(without submeshes), a part of the mesh is not there, but the vertcount remains like it the whole meshpart(including submeshes) with its vertices is being rendered, which isn't.
Well, seems "sharedMesh.CombineMeshes" causes this. Cuz another script using a different method works fine.
Your answer
![](https://koobas.hobune.stream/wayback/20220612054946im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Submesh Vertices 1 Answer
Count vertices of a gameobject 0 Answers
Skinned Mesh Renderer Combining submesh issue 1 Answer
Tessellation + total vert/tri count 0 Answers
Does CombineMeshes concatenate vertices, or concatenate references to vertices? 2 Answers