- Home /
DrawMesh slowing FPS
Hello everybody,
I have some question about the use of DrawMesh. First of all let me explain my goal. I try to make a editor extension to be able to paint Mesh on Mesh. (Paint Grass or tree on Sphere or rock for exemple). So i got a big headache with the rendering process. First i was instantiating a GameObject for each mesh and combine mesh to have only one mesh. The problem is how to erase mesh if they are merged and it make no sense to have thousand of gameObject instantiated since i don't move/scale/rotate them.
After that I look into another way to get it work. 1-Get an array of all the Matrix4x4 for the mesh. 2-Chunk the list to be sure we don't override the maximum int16 vertices to combineMesh. 3-Combine the chunk in one mesh ( I do that because you loose batching with DrawMesh so i do my own combine). 4-Draw each chunk with DrawMesh().
The problem here is: -If i instantiate 40 Gameobject i got around 166 batches in the stats. -If i draw 1 mesh (40mesh combine into 1) i got exponential increase of batches and all my computer just crash after 10min...
Is there a way to call Graphics.DrawMesh ? Maybe i do something wrong it's like each time i call DrawMesh with the same mesh the GC make a new mesh and never destroy the old one...
Just find an issue on Unity Here Open in 2013.... I think they will never correct it.
Your answer
Follow this Question
Related Questions
Dynamically creating a mesh with a hole in it from two lists of vertices 0 Answers
How to cut mesh and put cloth Behaviour in it at runtime Generated Cut Meshes? 0 Answers
Geometry in one room has a silhouette that shows through other geometry? 0 Answers
Help? Gaps between quads 0 Answers
Fixing mesh normals 1 Answer