I can not figure out these statistics. I have a scene that I made in LightWave and it has 1374 vdertices and 1608 polygons in LWs Scene Statistics.
The Stats window in Unity is telling me somewhere between 44k and 60k triangles depending on where I look.
The Vertexcount is through the roof at 841k!!
Now LW is not counting UVmaps, neither is it counting hard edge vertices as more than one. All that is of course contributing to the difference, but just looking at the triangles, I get some 40 times as many as I should have. I do have one UVmap per material (at most) and a Lightmap so that would be two UVmaps and maybe 3 times as many triangles because of that. Then I told Unity to generate colliders and I guess that in a worst case scenario, this would make the same number of triangles all over again (colliders dont need UVmaps, nor do the need hard edges, so they dont need double vertices, so it is only an extra 1374 vertices and 1608 triangles, at most). But even when I factor all this in, I maybe get 6k triangles all together. So why do I get 60k+ triangles in my statistics? What else am I missing?
Now the vertices are more complicated, but if I was to assume 6 triangles per vertex on average (so multiply times 6) and that times 2 in the UVmap and that then again times two (because of the two UVmaps), then I would still only get some 20k vertices (maybe). Unity tells me there are 40 times as much though.
So maybe I dont understand the statistics, or something went seriously wrong with my import from LightWave.
there was a thread about this - search for it - to much text to re-type it in there, but short version - it is ok - unity erroneously calculate it: for every material in your mesh it just add all vertices. Also when you start to add there shaders - they can become multi-pass due to lighting. If this still don’t help - search for thread and file bug-report
Colliders don’t add anything to rendering stats. I would guess the count is coming from your lights; if you turn them all off you will get just the number of vertices/triangles used by the models.
Thanks for the reply guys.
Eric, so I turned off all lights and the vertex and triangle count went down signifficantly. Of course all lights are off now too. So that is somewhat bad. I still have 3k triangles, which is what I would expect so that is fine (it is the two UV maps now, I guess). But, I still have 30k Vertices which is still a lot, considering that the scene should only have 1374. So that is because of the extra materials? Is this just a mistake in the statistics, or does Unity actually add these extra vertices to the scene for every material?
If it is just a problem in the statistics, then this is OK, I guess. If Unity actually adds these extra vertices to the scene, then this is bad. I would rather split the mesh for each material then, I guess.
Ok, so “calculate” means only in the statistics. It could be calculating them and puting them into the scene too. Sorry, I was not entirely sure what you meant by that. So I am assuming that they are not really there. This of course means that I still dont have an explanation for why my scene is so slow
I do have quite a few lights in the scene, yes. I was not expecting them to have such a huge impact on rendertimes, especially since all lights and (currently) all the geometry is static and marked as such. It would be cool if we could turn off self shadowing for static objects separately (currently there is only cast shadows and receive shadows). That way static objects could still cast realtime shadows on dynamic objects and receive shadows from dynamic objects, but use lightmaps only for everything else (and be fast that way).
Anyway, I will just bake all the lighting and (hopefully) figure out what to do with the dynamic objects and their shadows.
Maybe I will just use a single directional light for the dynamic objects, or at least less lights. That will not look quite as good, but it will hopefully be much faster.
I thought the whole point of defferred lighting was to allow for more lightsources with shadows, but right now I am finding myself reducing them again to just two
Beast is really good though. So at least that is a small help.
My machine is a Geforce M GTS 8800, One of the better mobile graphics cards.
No, it potentially allows for more point/spot lights, if they are small enough, since the cost is based on the number of pixels affected rather than the number of lights, but that doesn’t do anything for shadows, which are still costly, and additionally so for every source.