Fastest way to render colored cubes?

Hi everyone! I am attempting to render a bunch of colored cubes and am having some performance issues. The cubes are all connected. The cubes are all the same size. The cubes are different colors. Anyone know which opengl rendering methods would be the fastest for this scenario? Thanks.

It sounds like you’re making a Minecraft clone?

Most important optimizations: batch with VBOs, apply frustum culling, and apply face culling (connected faces won’t be visible).

More discussion:


A more modern GL approach (3.3+) would be to use geometry shaders or instanced draw calls.