Mesh per Chunk Vs. Mesh per Voxel
I am currently creating a minecraft like game and have been following a tutorial by AlexStv. In the tutorial he gets each chunk to collect the vertices, triangle, etc., information from each voxel and then generates a single mesh for that chunk. I am wondering whether it is more efficient to do this as opposed to simply creating a mesh for each voxel. If you could please list the positives and negatives of each scenario that would be really helpful. Thanks.
Tutorial - http://alexstv.com/index.php/posts/unity-voxel-block-tutorial
Answer by multinfs · Mar 05, 2016 at 05:49 PM
I have done a similar project before and here are some thoughts:
While having one mesh per voxel seems to be easy and versatile it really is not the way to go if you're thinking of making a big world, remember that each mesh adds one drawcall. Doing it this way also adds alot of unnecessary faces and vertices unless you add a custom culling script which in turn increases generation time even further.
Adding vertices of each voxel into one mesh not only decreases drawcalls but also increases generation performance since you don't have to add one GameObject for each voxel. One downside to this is that you have to use one shader for each Chunk (Most often this is not an issue though), this can be fixed by either dividing your mesh into two or three sub-meshes all with different shaders or just making a new shader that you pass custom texturing data to.
Your answer
Follow this Question
Related Questions
Shared or Non-shared Vertices for mesh generation? 0 Answers
Problem with Procedural Mesh Generation 1 Answer
Mesh wont render although there are no errors! 1 Answer
How can I identify the location of mesh triangles at run time? (Procedural Generation) 1 Answer
Issue with Modifying Vertices of multiple Game objects 0 Answers