Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Skinned meshes and LODs bug?

Discussion in 'Editor & General Support' started by swantonb, Jan 5, 2022.

  1. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    I am using 3 lod levels for my player models and 2 lod levels for my weapons.

    Apparently the GPU skins them all even if only one of the lod is visible. I made lod bias 100 to make sure only lod0 is taken into this test, so:



    Here you can see the meshes with all 3 lods active for all the players (i only used player models as test for this), all of the skinned meshes, including lod 1 + lod2 are enabled, there are 88 skinned meshes that need skinning.



    And here you can see the skinned mesh renderer count with the LOD1 and LOD2 skinned meshes of the player models manually disabled from the hierarchy.

    Is this normal behaviour? To be honest i dont notice *much* gpu time decrease between the 52 and 88 meshes skinning but still, if they are there they are getting skinned, right?

    So why are they getting skinned if the lod culls them?

    Also, why does skinning take so much time? the meshes have 50k verts on lod0 (but lod 0 is pretty much for first person view, when you are 2 meters away from the model the lod should switch to lod1), 10k verts on lod1, 5k on lod2. Skinning spikes between 0.3 ms to 11ms. What am i doing wrong? Is this normal mesh skinning performance? Skinning takes more than rendering for me.
     
    Last edited: Jan 5, 2022
  2. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Just replicated it in a new scene, just in case i was wrong, take a look at this:

    with 3 lods:


    With lods manually disabled from hierarchy:


    Also with skinned mesh components disabled from the hierarchy, and the game object enabled:




    So lods and skinned meshes dont work correctly, does this happen for mesh renderers too? extra draw calls for the ones that are not actually seen by the camera?

    Solution i guess would be disabling the meshes depending on the level of detail distance/size, right? Was this problem never encountered? Will a solution be implemented?

    Also reported a bug on this: Case 1392754

    Tested in Unity 2022.1.0b2 but i doubt it works good in earlier versions.
     
    Last edited: Jan 5, 2022
  3. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Aight this has been fixed. It was going on only in 2022.1.0b2, i assumed it was going on in earlier versions too but it was just that beta problem. Tested in 2022.1.1b11 too and it doesnt happen anymore.
     
    viktorasu likes this.