Voxel volume mipmaps generation via compute shader


I've got voxel volume mipmaps generation via a compute shader working.  It was a struggle because I knew little about implementing compute shaders from both the Vulkan and the GLSL side before tackling this, but I've learned a lot and am happy with the results.

  • Test scene: sponza-scale-0.3.vox (1152x512x768 or 78,887,176 non-air voxels)
    • Times from/to (on scene load) to generate voxel volume mipmaps:
      • CPU (only using one execution thread @ 3.20GHz) : 17 seconds
      • GPU via compute shader: 0.4 seconds

Keep in mind this compute shader mipmap generation is done in parallel on a per voxel volume basis, so if only one or two volumes are changed at a time while playing or editing in creative mode, the performance gain isn't mind blowing compared to what it used to be.

Next I will tackle voxel ambient occlusion optimization bits generation being done via a compute shader because that is computationally expensive when done only on the CPU.

After that, I will work on dynamic lighting (voxel cone tracing).

On the subject of voxel ambient occlusion optimization bits, I had gone from 6 to 20-bits per voxel for that, but that required going from 32 to 64-bit voxels.  I decided the performance gain wasn't worth doubling the RAM (video card and conventional) usage for voxel data, so I've reverted back to the less aggressive voxel ambient occlusion optimizations and 32-bit voxels, which still gives excellent frame rates.

Comments

Log in with itch.io to leave a comment.

(+1)

Wow.