I am trying to reduce the number of faces that are rendered in my voxel engine by implementing a greedy meshing algorithm similar to Mikola's (http://0fps.net/2012/06/30/meshing-in-a-minecraft-game/)
Since I am using a VBO to draw each triangle for every cube I am wondering how I will be able to merge the triangles of adjacent cubes?
For reference here is what my cube vertex array looks like (note that it is interleaved to allow for texture coordinates to be included):
GLfloat cubeInterleaved[] =
{
// Front face u v
-0.5f, -0.5f, 0.5f, 0, 0,
0.5f, -0.5f, 0.5f, 1, 0,
0.5f, 0.5f, 0.5f, 1, 1,
-0.5f, 0.5f, 0.5f, 0, 1,
// Right face
0.5f, -0.5f, 0.5f, 0, 0,
0.5f, -0.5f, -0.5f, 1, 0,
0.5f, 0.5f, -0.5f, 1, 1,
0.5f, 0.5f, 0.5f, 0, 1,
// Back face
0.5f, -0.5f, -0.5f, 0, 0,
-0.5f, -0.5f, -0.5f, 1, 0,
-0.5f, 0.5f, -0.5f, 1, 1,
0.5f, 0.5f, -0.5f, 0, 1,
// Left face
-0.5f, -0.5f, -0.5f, 0, 0,
-0.5f, -0.5f, 0.5f, 1, 0,
-0.5f, 0.5f, 0.5f, 1, 1,
-0.5f, 0.5f, -0.5f, 0, 1,
// Top Face
-0.5f, 0.5f, 0.5f, 0, 0,
0.5f, 0.5f, 0.5f, 1, 0,
0.5f, 0.5f, -0.5f, 1, 1,
-0.5f, 0.5f, -0.5f, 0, 1,
// Bottom Face
0.5f, -0.5f, 0.5f, 0, 0,
-0.5f, -0.5f, 0.5f, 1, 0,
-0.5f, -0.5f, -0.5f, 1, 1,
0.5f, -0.5f, -0.5f, 0, 1
};