Octrees and Vertex Buffer Objects

Posted by sharethis on Game Development See other posts from Game Development or by sharethis
Published on 2012-12-10T12:14:57Z Indexed on 2012/12/10 23:19 UTC
Read the original article Hit count: 243

Filed under:
|
|
|
|

As many others I want to code a game with a voxel based terrain. The data is represented by voxels which are rendered using triangles. I head of two different approaches and want to combine them.

First, I could once divide the space in chunks of a fixed size like many games do. What I could do now is to generate a polygon shape for each chunk and store that in a vertex buffer object (vbo). Each time a voxel changes, the polygon and vbo of its chunk is recreated. Additionally it is easy to dynamically load and reload parts of the terrain.

Another approach would be to use octrees and divide the space in eight cubes which are divided again and again. So I could efficiently render the terrain because I don't have to go deeper in a solid cube and can draw that as a single one (with a repeated texture).

What I like to use for my game is an octree datastructure. But I can't imagine how to use vbos with that. How is that done, or is this impossible?

© Game Development or respective owner

Related posts about opengl

Related posts about terrain