Well, this blog needed some fresh air, so here it is.
I have been working in my GI technique, and one aspect I wanted to fix was the voxel clear code.
As is the trend today, AHR relies on a voxelized scene representation to compute the GI, and given that the scene can change each frame, the grid needs to be cleared each frame also.
That is a problem, as calling ClearUnorderedAccessViewUint() on a 512x512x512 grid takes about 25 ms on my system ( GTX 750 Ti + FX-6300 ). It's quite a bad result, taking into account that, using a high quality preset, rendering the GI itself takes 25 ms.
So, how did I manage to bring that 25 ms down to 0.7 ms ( a ~3500 % improvement ) you may ask? Well, here is how.

I'm using 32 bits per voxel because DirectX forces me to do it if I want to use atomics, but the data I store doesn't need that much precision. So I took 8 bits out of the voxel, and use them to store a frame counter. When raytracing, I compare the ID from the voxel to the current frame ID to see if it's valid.
So now I have 256 frames to clear the grids, wich I do with a simple compute shader. I could use ClearView(), and that would be awesome, but it just for DX 11.1, and only ( to the extend of my knowledge) AMD supports creating a 11.1 device, so that's a no-go.

Overall, the results are really good. With that change, the total frame time got a 50% reduction, without any noticeable impact on visual quality.
Still have some things to fix, but the idea is there

Screenshot!


Pages

Powered by Blogger.