Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actuallarspensjo

Posted 10 April 2013 - 07:29 AM

One question is still unanswered: is it good idea to convert voxel-based terrain to 3D model (all terrain details and smoothings applied), so that in-game, instead of dealing with voxels and then geometry, there could be only geometry (quads, triangles) to render?

I think this is necessary if you want to get sufficient performance, but I don't know your requirements. Notice that using a block with half the width will increase the density of blocks with a factor of 8. There are some steps of varying complexity (from easy to hard):

  • Sort surfaces on type.
  • Remove hidden surfaces (sides of adjacent cubes).
  • Merge adjacent surfaces (triangles) into bigger triangles.
  • Detect what chunks are outside of the view frustum, and ignore them for drawing.
  • Detect what chunks are hidden behind other chunks. Sounds easy, but not trivial.
  • Implement LOD (Level Of Detail). This is complex for voxel based drawing, especially in the transition from one resolution to another that can lead to artefacts.
  • Use impostors for far distant chunks.

For smoothing, there are a couple of possible technologies. The marching cubes is frequently mentioned, but I think it is difficult if you are going to support more than one type of block. Another solution is to use a kind of a filter that transforms the corners of the cubes. You can see an example of it in my implementation. It will get you smooth terrain, but still with sharp boundaries between block types. There is also the concept of "Elastic surface nets". I haven't looked much at it, it may be similar to what I am using.

 

For the world editor, I switch between a smooth world display and a blocky display when I enter edit mode.


#1larspensjo

Posted 10 April 2013 - 07:10 AM

One question is still unanswered: is it good idea to convert voxel-based terrain to 3D model (all terrain details and smoothings applied), so that in-game, instead of dealing with voxels and then geometry, there could be only geometry (quads, triangles) to render?

I think this is necessary if you want to get sufficient performance, but I don't know your requirements. Notice that using a block with half the width will increase the density of blocks with a factor of 8. There are some steps of varying complexity (from easy to hard):

  • Sort surfaces on type.
  • Remove hidden surfaces (sides of adjacent cubes).
  • Merge adjacent surfaces (triangles) into bigger triangles.
  • Detect what chunks are outside of the view frustum, and ignore them for drawing.
  • Detect what chunks are hidden behind other chunks. Sounds easy, but not trivial.
  • Implement LOD (Level Of Detail). This is complex for voxel based drawing, especially in the transition from one resolution to another that can lead to artefacts.
  • Use impostors for far distant chunks.

For smoothing, there are a couple of possible technologies. The marching cubes is frequently mentioned, but I think it is difficult if you are going to support more than one type of block. Another solution is to use a kind of a filter that transforms the corners of the cubes. You can see an example of it in my implementation. It will get you smooth terrain, but still with sharp boundaries between block types.

 

For the world editor, I switch between a smooth world display and a blocky display when I enter edit mode.


PARTNERS