Hi there, I have some people who says parts of a level is slowing the FPS down. As the users can build the levels themselfs, I would like to examine the FPS and verts/tris in certain areas/levels.
I have a FPS running now, but how do I calculate the verts/tris run-time in a scene?
I cant find anything in script reference, so I guess its gotta be manually somehow. Is it "for each child gameobject in scene, calc verts/tris and check every child within too recursively" ?
if so, where do I find the verts and tris?
asked Sep 18 '11 at 09:03 PM
The Mesh-class has all you need. Every mesh is made up of vertices and triangles. With Mesh.vertexCount you can get the vertex count of this Mesh. The triangle count can only be queried by reading the length of the Mesh.triangles array and divide it by 3.
To get the overall vertex / triangle count in the scene just use this:
answered Sep 18 '11 at 10:09 PM