i toyed around with a little Hexagon-Voxel thing in Unity, and everything is working fine - except for some framerate hickups caused by CG.
I also found the problem - my terrain is divided in chunks (as usual when rendering Voxels) and with each chunk mesh-change my program allocates nearly half a MB of ram - which is of course not good. The profiler tells me that all of these memory allocation is caused by copying my vertex, triangle, uv etc. data from list to Array. (list.ToArray() call).
This is because i have some lists for vertices, triangles, uvs etc. which i fill in my CalcMesh routine based on my voxel data.
I can’t use static size arrays because i don’t know how many vertices/triangles etc. the mesh will have. Is there any strategy/trick/hack/whatever to avoid the list and work with something, which does not allocate this much memory?
I hope i could describe what i mean, and i hope for any ideas or solutions!