Jump to content

Fast Voxel Raytracing with Vulkan


Josh

7,164 views

 Share

PBR materials look nice, but their reflections are only as good as the reflection data you have. Typically this is done with hand-placed environment probes that take a long time to lay out, and display a lot of visual artifacts. Nvidia's RTX raytracing technology is interesting, but it struggles to run old games on a super-expensive GPU, My goal in Leadwerks 5 is to have automatic reflections and global illumination that doesn't require any manual setup, with fast performance.

I'm on the final step of integrating our voxel raytracing data into the standard lighting shader and the results are fantastic. I found I could compress the 3D textures in BC3 format in real-time and save a ton of memory that way. However, I discovered that only about 1% of the 3D voxel texture actually has any data in it! That means there could be a lot of room for improvement with a sparse voxel octree texture of some sort, which could allow greater resolution. In any case, the remaining implementation of this feature will be very interesting. (I believe the green area on the back wall is an artifact caused by the BC3 compression.)

I think I can probably render the raytracing component of the scene in a separate smaller buffer and the denoise it like I did with SSAO to make the performance hit negligible on this. Another interesting thing is that the raytracing automatically creates it's own ambient occlusion effect.

Here is the current state, showing the raytraced component only. It works great with our glass refraction effects.

Next I will start blending it into the PBR material lighting calculation a little better.

Here's an updated video that shows it worked into the lighting more:

 

  • Like 4
 Share

12 Comments


Recommended Comments

Hey @JMichaelK Got a few questions about your Voxel ray tracing implementation - 
1. What hardware is required to run this? 
2. Does this work well in Virtual Reality?
3. Does this work well for large worlds?

Link to comment

1. Nothing special. Should run fast on integrated graphics when I’m done with it.

2. Yes

3. I don’t think the size of the scene matters but it has a limited range around the camera.

  • Like 1
Link to comment
Just now, JMichaelK said:

1. Nothing special. Should run fast on integrated graphics when I’m done with it.

2. Yes

 3. I don’t think the size of the scene matters but it has a limited range around the camera.

Good to hear that nothing special will be required to run and it will run well in Virtual Reality. 
I am on a MSI 570 8GB Video Card so hopefully it will be sufficient for this. :)

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