I am creating a terrain with level of detail changes which seamlessly interconnect between lower and higher level of details. There are two ways I can do this in the script.
One method I could add and delete vertices and polygons on already existing mesh in realtime or I could add and delete plane objects which would have to their vertices tweaked after to fit a height map. Which method do you think would be faster? I don’t know if adding and deleting vertices and polygons may have to redraw the entire mesh, whereas adding and deleting plane objects might be slower for Unity.
Though I haven’t used it myself, Unity supports something named LOD group (__L__evel __O__f __D__etail). I assume this is something which you want to acchieve (though it is limited to Unity Pro, prior to Unity 5).
Should you want to reinvent the wheel, there is a third option: en-/disable a GameObject. This has less overhead than destroying and recreating… things.
As for editing meshes, it does have quite some overhead. First you have to retrieve the data, copying everything into memory. Then edit it, to finally writing everything back, essentially copying it again.
Mud, are you sure editing meshes works that way? I thought once you created the arrays and assigned the reference to the mesh, you were free to edit the vertices and so forth like any other array. Surely the mesh class isn’t really copying the whole thing each time you change a vertex or something? Don’t know for sure, maybe I’m wrong about this one.
Granted, AustinLee is talking about changing the number of verts and redoing a lot of the triangles. Maybe in that case it needs to be a new mesh after all like you said since the number of elements in the mesh array changes.
Anyway, LOD is probably a better option anyway. Good thinking.