Jump to content
  • Advertisement
Sign in to follow this  
dangerdaveCS

Voxel mesh generation

This topic is 3988 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I'm representing a deformable surface using a 3D lattice of voxels. The voxels define a closed surface visually, but of course it displays rather slow as I am drawing millions of cubes rather than drawing a closed mesh wrapped around the surface. Can anyone point me to any algorithm for such voxel -> mesh generation? I tried google, but just seem to get 3rd party apps and research papers. Oh and I'm using Direct3D9 if it makes any difference. Any help much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
AFAIK, voxels can be rendered much efficiently by raytracing than rasterising...

Share this post


Link to post
Share on other sites
As people have pointed out, you can use the marching cubes algoithm to convert voxels to meshes. That is assuming your voxels lie on a regular grid, rather than being some kind of arbitrary point cloud. However, you typically expect 2-3 triangles per surface voxel so it's still a lot of triangles.

Are you building vertex buffers with the resulting data, or are you sending it to the GPU each frame? The later will really kill the performance. If your voxels are moving then ideally you only want to send the the GPU the parts which have changed between frames.

There are other approaches which produce less triangles in flat areas of the volume... google for "volume surface extraction" or something similar. Or ask me if you still can't find anything.

Otherwise use marching cubes and consider mesh decimation techniques as a second step.

You may find my project here interesting, it represents game environments as voxels and runs marching cubes for destructible environments:

http://www.ogre3d.org/phpBB2/viewtopic.php?t=27394

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!