- Home /
Splitting a Mesh into Submeshes
I am currently trying to modify meshes in runtime and therefore also updating their colliders at runtime.
Since I am using rather big meshes I was wondering whether it is possible to split an existing mesh (either within Unity or beforehand manually somehow) into multiple submeshes - sorted by "connection" of triangles. This way I could probably achieve a much higher performance since I would not have to modify the "whole" mesh but smaller parts of it.
In Unity 5.6 and older there already was a vertice limit of 65535 which made Unity split the mesh automatically but without paying attention to connected triangles or so and therefore not too useful.
Answer by Ermiq · Aug 29, 2018 at 03:46 PM
I doubt one could split meshes right inside Unity.
You need to use 3D modeling software to do that. For example, here's how you could do that in Blender (selecting different parts and making them separated meshes is starting from 6:25): https://www.youtube.com/watch?v=vUgQcSkFWBU&t=600s
Yeah I've worked with Blender before to modify meshes. I just hoped that it might be possible to do so automatically within Unity for different meshes. I will try modifying it within Blender for now and see whether that helps performance-wise. Thanks though, I appreciate your help!
You absolutely can split meshes.. You could build a 3D $$anonymous$$odeling application with unity. Unity is fully capable of doing practically anything you could imagine. =]
Answer by myzzie · Sep 04, 2018 at 07:44 AM
https://answers.unity.com/questions/312492/submesh-creation-from-script.html
Shouldn't this answer your question?
Thanks, in general this would answer the question regarding the overall creation of submeshes, yes.
Splitting the mesh randomly is not that much of a problem, but I am not sure yet on how to split it with regards to the triangles order/position to always have fully connected meshes (e.g. seperating the mesh into 5 submeshes of equal size from left to right with the intersections for$$anonymous$$g planes inbetween to always have a closed hull).
As stated in the link above, what you're talking about is not submeshes, but multiple meshes in children.
$$anonymous$$ay I ask what this mesh resembles?
Ah yes, sorry. I kind of just assumed that it was still called submeshes. What I want is the original mesh split into multiple seperate meshes that can be seen as single gameobjects in general.
The mesh shall resemble anatomical structures, especially organs, venes and other tissue. I am trying to modify these models in runtime and therefore have to adjust their colliders as well. The collider calculation for high-res meshes is quite costly though.