Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

GPU Voxelization



After testing and some discussion with other programmers, I decided to try performing voxelization on the GPU instead of the CPU. The downside is the memory usage is much higher than a sparse voxel octree, but I found that sparse voxel octrees were very slow when it came to soft reflections, although the results of the sharp raycast were impressive:

You can read the details of GPU voxelization here if you wish.


Initially I thought the process would require rendering the scene in one pass for each slice of the volume texture, but it is actually possible to voxelize a 3D scene in just one single pass. Implementation was fairly difficult, but it's finally working:


The voxelization process is very fast, fast enough to do in real-time. That means the problems I had earlier with reflection lag (shown below) should be eliminated with this approach. Animated characters should work with absolutely no problem as well:

I am experiencing some flickering when multiple triangles contribute to a voxel. Because the volume texture is written to in random order, one imageStore() operation might overwrite the result of another one, and the "winning" pixel (last one drawn) can change from frame to frame. So that's something that needs to be solved.

  • Like 2
  • Upvote 1


Recommended Comments

Here is the scene with direct lighting. This is the information that is used to make reflections, so it looks fairly low-res:


  • Like 3
Link to comment

Do you mean you voxelize every frame? I thought it's something that gets baked once and them voxel models follow regular models.

Link to comment

It's every frame now. It's very fast, but it uses a lot more memory than my previous approach.

  • Upvote 1
Link to comment
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...