Level of detail for smooth voxel terrain

Over the last couple of weeks I’ve been continuing my integration efforts between PolyVox and gameplay3d. This is proving to be extremely useful as a way of identifying the problems and limitations within PolyVox, especially as I haven’t worked with smooth voxel terrain for quite a while (since before Voxeliens). In particular I have been focusing on level of detail support, and as you can see below I have had some success:

The MeshDecimator class has recently been deprecated, and I’ve been saying for a while that down-scaling the volume data and running the Marching Cubes algorithm on this smaller data is probably a better way to achieve LOD for smooth terrain. There is even an example in PolyVox which demonstrates this on a sphere. However, doing it on a real world dataset has proved to be a bit more complex, and I can see now that some changes need to be made to the way PolyVox handles sampling outside a volume and to the way the VolumeResampler works. But in principle it does seem like a sound approach.

That said, there’s still an issue with cracks between the mesh patches where the LODs don’t line up exactly (you can’t really see this in the screenshot because it’s wireframe). Some tests have shown that simply overlapping the meshes slightly seems to be a viable solution, but again I need to make some changes to PolyVox to support this more naturally. Of course, the Transvoxel Algorithm is also a more robust solution which may make an appearance in the future.

Next up I’m expecting to look at physics integration for both the smooth and cubic styles of terrain.

Share
This entry was posted in Uncategorized and tagged , by David Williams. Bookmark the permalink.

About David Williams

David is a post-doctorate researcher at the University of Groningen, The Netherlands, where he is investigating GPU computing. Prior to this he worked in the games industry and wrote graphics/engine code for a number of PC/PS3/XBox titles. As well as making games he occasionally enjoys playing them, and also sometimes gets outside to do some photography.

6 thoughts on “Level of detail for smooth voxel terrain

  1. Simply overlapping the meshes is probably not a good solution, if a solution at all. You’ll get texture seams, as well as other odd corner cases where overlapping just won’t work.

    There are quite a few solutions out there to this problem. I would suggest further research.

    • I have tested it in a kind of hacked together kind of way, and I was suprised not to see any texture seams at all. I think the use of the triplanar texturing makes things easier here as there are no texture coordinates to mess up.

      But yes, I agree the cracks could still be visible, particularly at grazing angles. I need to do more tests here to see if it’s really a problem. The Transvoxel Algorithm would be a proper solution though it’s also more complex.

    • I don’t think that overlapping the meshes would be that bad. In fact Miguel Cepero does basically the same thing, only with much more complicated geometry and he claims that the results look just fine (and judging by the screen shots I am inclined to believe him):

      http://procworld.blogspot.com/2011/10/playing-dice-with-mesh-simplification.html

      I’m not really convinced that implementing something like transvoxel would give you enough of an advantage to really be worthwhile in a rendering pipeline, but perhaps I am missing something.

  2. What about fine details like small cave entrances and such? Downsampling voxel volume may lead to loosing these details and artifacts like cave invisible from some distance suddenly popping into view (because downsampling missed this detail). How would you downsample volume to preserve these details?

    I’ve been through downsampling, transvoxel algorithm and so on, and right now I’m thinking the opposite of what you said – I’m thinking about using full-res mesh and simplifying it for LOD levels – this way you will keep small details like caves, ground holes and so on, which otherwise are lost.

    • I agree that downsampling has a probem with small details being lost, and currently I’m just expecting to make sure that happens far enough away that the user doesn’t notice. It’s not a perfect solution but it does seem pretty robust.

      I have played with mesh simplification in the past and I found it quite difficult, particularly when there were multiple materials in the terrain and also on the boundaries between different regions. I was using my own simplification library though (which was slow) and it’s possible better results would be achived with an existing library (e.g. OpenMesh) or by someone with more experience in mesh processing.

      But overall I’m happier with volume downsampling so far.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>