Jump to content

GPU Voxelization


Josh

2,654 views

 Share

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.

Voxelization_blog_fig_2.thumb.png.7690c218d91eab6898a0b47824512054.png

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:

Image2.thumb.jpg.f0b77ba8790216471ea918991af28d1b.jpg

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
 Share

4 Comments


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:

gi.thumb.jpg.c6306d161a7c9f4f3e3634ccf63c3d1b.jpg

  • 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
Guest
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...