I’m doing a script to log all the verts/tris number of a mesh group. And I found that I just cannot get the same number with the stats window shows. Even for one mesh in the group.
The meshes belong to an imported fbx file. And one mesh has multiple materials. We’re not sure whether it would affect the verts count.
Actually we have no idea about how Unity counts the verts number, if we can get it we can know the number for each one in the whole group.
I looked for it on Unity’s website but didn’t get it. So please help. Thanks very much!
It’s based on the final amount passed to the GPU. This might be more in forward rendering with pixel lights and post fx. It’s never based on the mesh unless you’re going over 65536 or however many attributes for dynamic batching.
Generally, Unity’s numbers are probably very hard to replicate without in-depth knowledge of the renderer. You need to know which shaders the mesh is rendered with, and how many passes each shader is used for - which may depend on the numbers of lights used (depending on forward or deferred rendering), on whether or not shadows for those lights are enabled, etc, etc.