Getting an accurate count of triangles!

Hi,
I’m using SteamVR/Rift/Unity2071.3.1f1. I get a different number for “tris” (in the stats) window and I’d like to know which one is “correct”!

I have a scene with a single active camera, field of view 96, far plane 10000, etc.

  • View scene in editor with active camera. Stats says 137K tris.
  • Run the scene with same active camera (the Rift is detected and I can view a stereo image in the headset. Stats reports 365K tris (when looking in the same direction the camera is facing in the editor). It’s more than double so that’s a bit weird (I would expect close to double, one for each eye). Also, the “field of view” isn’t as wide in the headset so maybe I’m misunderstanding it, or it’s being modified by SteamVR or something).
  • Run the scene as part of my game and I get 860K tris!

Maybe there’s some tessellation happening? Just wondering what’s the best way to get a good idea of tris while working in the editor so I can estimate what the final scene complexity will be.

Thanks!

Rendering from two cameras doesn’t change the geometry. Unless you’re loading assets at runtime, the tri count shouldn’t change - should it? I’m curious to the explanation for this.

i believe if your using real time lights, unity will tesslate your model to do vertex lighting so thats whats giving you the extra tri’s. this really confused me too when i first started using unity…

The triangle count shows how many (total) were rendered in all passes, including light prepass, shadow cascades, stereo, etc.

If you use the Frame Debugger to capture a frame in the editor, you should be able to find the extra triangles

Thanks everyone. Stuart - is there something I should look for in the Frame Debugger that shows the “duplication” when rendering? i.e. if it’s caused by “shadows”, are they under separate (obvious) root nodes in the hierarchy?

Thanks!

Yes, you’ll see the mesh being rendered under Shadows.RenderShadowMap, for example, in addition to RenderForward.RenderLoopJob