Sign in to follow this  
qrcze

Octree voxel model surface

Recommended Posts

qrcze    122
Hi, Recently I have been working on simple destructible voxel model engine. For memory conservation I use octree structure to keep my voxels. If node is completely solid I mark it as a leaf and if it is completely empty I delete it and mark it as NULL. This technique makes geometric data quite compact, but unfortunately I have problem with rendering. Rendering all leafs as cubes is simple, but most of the cubes are invisible, what makes this method inefficient for high resolution octrees. I'm looking for a method to determine if leaf is visible before rendering it. I was also thinking about surface extraction, but I have no idea how to reconstruct surface from nonuniform voxel model (maybe some marching-cubes mutation?). Cheers! P.S. Excuse my imperfect English.

Share this post


Link to post
Share on other sites
JohnBolton    1372
Here are a few ideas:
  • Traverse the tree and render only voxels having no neighbors (or having neighbors of the voxel's size or smaller) on the sides facing the camera. It's O(n2) so it's not a great solution, but it might be faster than rendering occluded voxels.
  • Rather than drawing a voxel as a cube, draw it as a depth sprite.
  • Draw the sub-octants for each octant front-to-back. That is pretty easy to do and you will take advantage of the video hardware's ability to cull occluded triangles.

Share this post


Link to post
Share on other sites
PolyVox    712
Hi, I have done something similar to what you are doing. I would recommend the surface extraction approach using Marching Cubes or a similar algorithm. If you render every voxel as a cube you'll get a lot of polygons and it's hard to get a smooth look.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this