This repo is implementation of different GPU BVH build methods and optimizations. Following methods are on the roadmap.
Note : You might find function duplication in the kernel files. I did not get time to refactor this much though it helps to understand code as we have all code in one file.
Leaf Node Visits
Timings for Bunny Box(150K triangles) on RX6800 AMD
-----------------------Perf Times----------------------------
CalculateCentroidExtentsTime :0.247701ms
CalculateMortonCodesTime :0.037101ms
SortingTime : 0.1635ms
BvhBuildTime : 0.693201ms
CollapseTime : 2.9558ms
Bvh Cost : 22.6397
Total Time : 1.1415ms
Timings for Sponza(260K triangles) on RX6800 AMD
-------------------------Perf Times------------------------
CalculateCentroidExtentsTime :0.223ms
CalculateMortonCodesTime :0.082599ms
SortingTime : 0.249ms
BvhBuildTime : 0.929ms
CollapseTime : 3.6383ms
Bvh Cost : 59.4779
Total Time : 1.4836ms
Timings for Bunny Box(150K triangles) on RX6800 AMD
------------------------Perf Times------------------------------
CalculateCentroidExtentsTime :0.2209ms
CalculateMortonCodesTime :0.0465ms
SortingTime : 0.173501ms
BvhBuildTime : 0.4865ms
CollapseTime : 3.3596ms
Bvh Cost : 22.6397
Total Time : 0.927401ms
Timings for Sponza(260K triangles) on RX6800 AMD
-----------------------Perf Times---------------------------
CalculateCentroidExtentsTime :0.224899ms
CalculateMortonCodesTime :0.0853ms
SortingTime : 0.2496ms
BvhBuildTime : 0.428799ms
CollapseTime : 3.316ms
Bvh Cost : 59.4779
Total Time : 0.988598ms
Timings for Bunny Box(150K triangles) on RX6800 AMD
-----------------------Perf Times----------------------------
CalculateCentroidExtentsTime :0.2593ms
CalculateMortonCodesTime :0.070599ms
SortingTime : 0.177599ms
BvhBuildTime : 0.5147ms
CollapseTime : 3.3104ms
Bvh Cost : 21.9676
Total Time : 1.0222ms
Timings for Sponza(260K triangles) on RX6800 AMD
-----------------------Perf Times---------------------------
CalculateCentroidExtentsTime :0.279299ms
CalculateMortonCodesTime :0.204699ms
SortingTime : 0.2535ms
BvhBuildTime : 0.6133ms
CollapseTime : 4.0426ms
Bvh Cost : 48.2362
Total Time : 1.3508ms
Timings for Bunny Box(150K triangles) on RX6800 AMD
-----------------------Perf Times---------------------------
CalculateCentroidExtentsTime :0.1981ms
CalculateMortonCodesTime :0.0776ms
SortingTime : 0.1944ms
BvhBuildTime : 0.688ms
CollapseTime : 3.2174ms
Bvh Cost : 21.9248
Total Time : 1.1581ms
Timings for Sponza(260K triangles) on RX6800 AMD
-----------------------Perf Times---------------------------
CalculateCentroidExtentsTime :0.2975ms
CalculateMortonCodesTime :0.1004ms
SortingTime : 0.2598ms
BvhBuildTime : 0.983297ms
CollapseTime : 4.3278ms
Bvh Cost : 48.842
Total Time : 1.641ms
Note : Timings are on AMD 6800W Pro