I’ve noticed a difference in the triangles that are reported for the same model in the mac version of unity3d vs the iphone version.
Attached are mac and iphone project and an image of the statistics windows for each. Materials are vertex lit so it shouldn’t be pixel lighting duplication.
The iphone screenshot had “Automatically calculate normals” checked but even disabling that gives me Tris:21 Verts:8. Instead of what i would expect which is Tris:12 Verts:8.
Interestingly if i dump the triangle count via script i always get: mesh.triangles.Length / 3 == 12.
Can someone enlighten me how the “Tris: 21” is calculated on iphone vs mac unity.
Pretty surely because you have a material that on the iphone requires multipass rendering or because you have lights in the scene or due to UV seams etc
Basically what’s happening is that Unity is trying to display your mesh in as few triangle strips as possible. To do this it creates degenerate triangles at points of discontinuity (mesh seams, UV border edges). These triangles are invisible, but they’re there. The performance impact of these triangles on a desktop is so small that they’re just ignored when we output the mesh information. Their impact becomes much more important when targeting the less powerful hardware of the iphone. That’s why the counts are different in the two editors.
So as degenerate triangles have a performance impact on the iphone, its good to reduce the number of them that will be generated.
I’ve only seen one technique to do this which is:
Making the uv as continuous as possible (like in “Continuous Mapping” section here: news).
The other thing i’m trying to visualize is how a cube requires 9 degenerate triangles (21-12). Is that purely based on the uv coordinates or is there something else that can be done with the mesh.
We are having exactly the same problem, and would love to know how to go about fixing it.
Our model has 3.1k tris, though in Unity iPhone has 5.5k tris. We have no lights, and a single material which does not require multiple passes. It used to have 8k tris, but our artist combined all the UV shells in to 1, which dropped it to 5.5k, but this is still well above 3.1k tris.
Because of this we wanted to do some testing, so we created a simple cube and exported it in to Unity iPhone as fbx (from Maya). Just like russeltracey we are seeing 32 tris and 24 verts no matter what we do with the cube and the material (no lights).
We then made a new cube using Unity to create the game object (not importing from Maya). Same result - 32 tries and 24 verts.