Hello,
Im trying to implement an empty space skipping acceleration structure using DDA lien algorithm and an occupancy map. Its simple in theory, pre-process a volume in a 1/8th resolution map and record each 8^3 voxel regions max intensity iso value. Then in the shader sample from the coarse grid using the DDA algorithm, when you encounter an intensity greater than the threshold sample in fine detail starting from the Last t to the current T value along the ray. Theses t values are the intersection boundary points of the voxel.
My issue seems to be how to map the t values into the original volume, you would assume: p = (rayDir * lastT) but thats not correct, see below the original and the empty space skipping version.
The full source code is here:
https://github.com/James-Emmett/Rune_2
Shader specifically is here yuo may only need to look at it to spot the error…:
https://github.com/James-Emmett/Rune_2/blob/master/Demo/Assets/Shaders/Volume/PBR_Volume.hlsl
Libs because Github Removes them (stored in the External folder next to include, and version libs copied next to demo exe) are here:
https://drive.google.com/drive/folders/1DKwf6hTCpSyBMy-I7b0dJQszFeAzjS5r?usp=sharing
If anyone spots the error please let me know i have tried everything.
Thanks