Search Unity

BUG? Unity splits meshes on import it does not need to!

Discussion in 'Editor & General Support' started by MikeUpchat, May 20, 2014.

  1. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Hi There
    Wonder if someone can help me with what I think is a pretty silly bug in Unity. I have an object which is a single sphere mesh which has 33642 vertices and 67280 tris so well below the vertex limit of 65535 but when I import that into Unity it gives the warning 'Meshes may not have more than 65535 vertices' and that it will be splitting the mesh. So ok just to check as Unity can add in extra vertices for smoothing groups and uv seams etc, even though this object is a sphere with no such issue I check the data and there are two meshes for my object one has 33106 vertices and 65534 tris, the other 941 vertices and 1746 tris.

    So why is Unity splitting the mesh on the tri count and not on the vertex count? Is this just a simple case of a bug in Unity where the developers have just picked the wrong value for the limit check? I know Unity can handle meshes with 60000 vertices and more than 65535 tris as I have created some using packages from the Asset Store.
    Mike
     
    Last edited: May 20, 2014
  2. twiesner

    twiesner

    Joined:
    Oct 4, 2011
    Posts:
    309
    The error is correct. The vertex count in your 3D app is not accurate for what the mesh actually is when imported into Unity. When importing into Unity you need to keep that the vertex count can change due to uv mapping, additional maps like normals, what type of lights you have in scene, etc.

    Is there a reason why you need such a high poly sphere?
     
  3. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Also, if you have modifiers on the object they will be applied which will drive your vert/ploy count way up. And as twiesner asked, why such a big sphere?
     
  4. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    That is not the cause Iam afraid, the vertex count on the meshes inside Unity adds up to just over 34,000 vertices, miles short of the 65535 limit.
     
  5. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Sorry for necroing thread but thought it'd be better to ask here than make a completely new thread.

    Is there a way to see this "real vertex count" in Unity? Because the one shown in the inspector when selecting a mesh with supposedly too many vertices isn't anywhere near 65k vertices.
     
  6. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    The count shown in Unity is the actual value, there is a bug in the mesh importer that splits meshes it seems on the count of number of faces * 3 I have submitted a bug on this as it is clearly a bug but so far Unity say they are just looking at it and that it is correct to split a mesh based on the number of faces times 3 which is clearly nonsense, they did also say that they looked at the code and didn't quite understand what was going on. Best thing to do is submit a bug report, the more people who do the more pro active Unity might be to fix this glaring issue.
     
  7. OllyNicholson

    OllyNicholson

    Unity Technologies

    Joined:
    Jun 17, 2011
    Posts:
    142
    Hi - this is not a bug with the mesh importer so much as the messaging output unfortunately. According to bug number 604417 - we will be changing the text to 'Meshes may not have more than 65535 vertices or triangles at the moment' so that people have a clearer indication of the mesh splitting implementation.
     
    BrandyStarbrite likes this.
  8. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Thanks Olly, that should clear up the confusion.
     
  9. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    But why can a mesh not have more than 65535 triangles, you can create procedural meshes with 65335 vertices and more than 65535 triangles so why can't Unity import such a mesh without having to split it it up?
     
    kuirp likes this.