Search Unity

Unity is giving me ridiculously vert counts... why?

Discussion in 'General Graphics' started by ElysianOne, May 21, 2018.

  1. ElysianOne

    ElysianOne

    Joined:
    Aug 16, 2017
    Posts:
    7
    So, I'm experimenting with some super simple driving mechanics and I've imported a model of a car to use for early testing. The model is quite poorly optimized at the moment, which I freely admit- about 20k verts, according to Blender. My scene looks like this:

    upload_2018-5-21_21-50-59.png

    It's extremely simple, just the car and a flat road. However, the stat page informs me that I'm rendering about 750k verts, but only 65k tris...

    upload_2018-5-21_21-51-59.png
    I'm on deferred rendering- on Forward it was rendering almost 1m verts- and I have absolutely no idea why the rendered vert count is so incredibly high. If anyone has any ideas, please do throw them my way!
    Many thanks in advance for the help.
     
  2. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    No idea why your tri to vert count difference s so large what are your shadow settings? Shadows alone double and add in cascades and it can add up a lot try the scene without any shadows and see what you get.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Ignore the vertex count in blender. Real time vs. "offline" renderers are very different when it comes to his vertices are counted. That said the fact the vertex count is 11 times the tri count married me think there's something very wrong with that model. The absolute worst case should be 3x, and even then that should never happen unless your model is faceted. It sounds like your models have a lot of stray vertices with no tri connection some how.

    You mentioned Blender, are you importing as a .blend or a .fbx file? Try exporting from Blender as an .fbx file if you're using a .blend file for the Unity asset, I've seen too many stories of weirdness with blender files. Also look at the asset in Unity, you can see the vertex counts Unity thinks each mesh has by expanding the model asset and looking at the individual meshes contained inside. I wonder if you won't find some meshes with no apparent geometry.
     
  4. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    Just checked on a castle model i have. In blender 138k tri 179k vert in unity 350k odd tri 7.5 million verts lol.No shadows on i even turned out the light and still the same i then tried let unity recalculate the normals and it went up a further 300k.
    But the even stranger part is my computer isn't very powerful 7mil verts ought to bring it to its knees yeet its galloping along at 150 fps.I duplicated the model 3 times and even at 23 million verts was running over 60 fps

    I think unity must be in error i trust blenders numbers far more than unity's 50 times the number return
     
    Last edited: May 22, 2018
  5. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    LeftoverAtoms likes this.
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    To be fair to @tawdry , the vertex counts being reported by Unity in the stats window are rediculous. While the Blender numbers are not going to match Unity, the difference should be no more than 3x, not 50x. It means either there's a bug in Unity's stats, or an issue with the importer.
     
  7. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    you could toggle individual objects on and off and see if one makes the difference. Then also check the meshes in the importer if the vertecies are already imported. So you could collect hints if it is indeed a bug or if there are simply useless points imported. What is the vertex count in Blender?
    Have you checked optimize mesh and weld verticies on the mesh inporter settings?
     
  8. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Okay. In blender, put your car model into edit mode. Press Tab.
    Select all of the vertices. Press A.
    On the left hand side menu panel, press the button called remove doubles.

    Then save the project.

    Re-import the car into unity and see if the vertice count, has dropped
    to a lower number.

    If it works, I'll explain, what happened.

    PS: If you want, you could make a copy of your car model project file
    and use that project file, as a test dummy.
     
    Last edited: May 22, 2018
  9. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    I already checked the castle model for doubles doesnt change the fact that a reported 21 million verts is been treated fps wise as closer to what i would expect from around 800k verts
     
  10. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    @tawdry
    Try to disable the skybox rendering from your main camera by going to the inspector and select solid color on clear flags and see if the vertex counts would drops a lots. The default Unity skybox is actually quite heavy. Post processing stack will also increase some vertex counts too.
     
  11. Kumo-Kairo

    Kumo-Kairo

    Joined:
    Sep 2, 2013
    Posts:
    343
    Sending a project with the imported model would help a lot. Please do if it's possible (maybe with another model with the same "symptoms" if you are afraid your car will be "stolen")
     
  12. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    Well skybox isnt really all that heavy it adds only 1.6k to a scene and doesn't multiply anything like shadows do etc.No post effects added and as mentioned my computer isnt behaving like its staring at 7 million verts and runs smoothly when the castle is duplicated 3 times and a total of 23 million verts.I haven't noticed this with other models so no clue why it does it but this must be unity spazzing out.
     
  13. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I know this is an old thread. I just wanted to answer what the issue could possibly be in case anyone runs across this issue.

    I've noticed that models without smoothing groups can increase the vertex count dramatically. Unity will split vertices when faces have hard edges. I've had models with only 3k vets in Blender, show 13k verts in Unity when no smoothing groups where used. I know its not as extreme as your situation, but just throwing it out there.
     
    lhoward95 and BrandyStarbrite like this.