PDA

View Full Version : Element batching from vertex position data



EmJayJay
06-04-2015, 10:34 AM
I'm creating and drawing a mesh from voxel data and the mesh type varies between solid and liquid but lets just focus on meshes created from solid voxels only.

The basic idea was that I create first 3D-array of vertex positions which can be used to draw voxel group of 64 * 32 * 64 (xyz) individually if needed using Element draw calls. I then just keep changing the Element buffer tied to the VAO to provide the right indices and changing the color buffer to match the elements been drawn.

I was just thinking what would be the best solution when drawing multiple groups. Use multiple VAOs? Use offsets inside VAOs for multiple voxel groups and edit one part while drawing another? Or something else?

The voxel size would be 0.5f where the unit is in meters.