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

Submeshes missing from asset bundle

Discussion in 'Asset Bundles' started by peteradvr, Jul 6, 2017.

  1. peteradvr

    peteradvr

    Joined:
    Dec 22, 2016
    Posts:
    11
    I've hit a situation where an asset bundle is missing the submeshes from the original content I've built it from. I'm trying to figure out if this is a configuration problem on my side, or if it might be a unity bug. Any ideas would be appreciated.

    Here is my original model in the editor before building it out as an asset bundle. I clicked the mesh filter and cut/pasted the inspector window in the upper right corner. You can see it has 5 sub meshes:
    Composit01.png

    Now here is the same model loaded from the asset bundle that got built from the above model. Note the warning in the mesh filter "This renderer has more materials than the Mesh has submeshes. Multiple materials will be applied to the same submesh, which costs performance. Consider using multiple shader passes." It looks like the first material is getting applied to the whole Mesh. When I double click the Mesh filter the inspector doesn't list any submeshes. (Again cut/pasted into the upper right corner of the image):
    Composit02.png

    The model in question came from an OBJ file. I'm not sure if that would play into the issue or not.
     
  2. peteradvr

    peteradvr

    Joined:
    Dec 22, 2016
    Posts:
    11
    ok the issue is for sure OBJ specific. There was an MTL file associated with the OBJ file. I guess unity was able to generate the submeshs when the MTL file was in the editor but with out it being present after the asset bundle build it didn't know how to process the submeshes any more. I used an autodesk FBX converter and the problem went away.