Hey!! So I've been working on a voxel-mesh engine and it's turning out great (turns voxels into a cubic mesh for rendering, like Minecraft). I started with rendering chunks one block at a time, and then I switched to rendering each chunk as a mesh, only rendering the "shell" or outside of the mesh. The problem I'm having now is this:
The mesh is made up of one material. Clearly adjacent quads/squares (voxel faces) on the mesh, being made of the same material, should be able to be combined into a rectangle, therefore reducing the triangle and vertex count. How can I do this?
As for my Mesh class, I have the following data stored:
-a Vertex array
-a VertexNormal array
-a vertexColor array (materials are colors, not textures in my game).
-an triangleIndices array (for rendering).
-a quadIndices array (for simplification).
and I can add and remove from these as I need to, using the proper notation and algorithms (dont remove a vertex without removing triangles with that vertex, etc.).
Is there something else I'd need to add to my data storage for meshes? Any idea of where to start algorithm-wise for triangle/quad reduction? As chunks reach the top of the terrain (where the chunk will have air and blocks, not just blocks), I have trouble creating a working algorithm for storing the quadIndices in a way that I can simplify the mesh easily...
Help please! I feel like I could be close, but I feel more lost than ever right now :/