Skip to content

Allow for various construction algorithms in BVH.

Stephan Hageboeck requested to merge hageboeck_BVHConstruction into master
  • Add a constructor parameter to the BVH class to choose between different splitting functions.
  • Move existing splitting algorithms into dedicated functions.
  • Make the choice of splitting algorithms available in BVHManager.
  • Make SurfaceAreaHeuristic the default, since it outperforms its alternatives.

The two new algorithms are:

  • LargestDistanceAlongAxis
    • Along each axis scan the lower-left front corner of the bounding box of every primitive.
    • Find the axis where the distance between the first and last corner is maximal.
    • Split in the middle between those.
  • SurfaceAreaHeuristic The SAH is very common in graphics applications. It minimises the surface of BVH nodes, so the likelihood of those nodes being intersected decreases, leading to faster convergence during node traversal.

There's room for more, but that only makes sense when we don't deal with one BVH per logical volume.

AdePT's example 13 changes as follows: BuildProducts/bin/example13 -particles 10000 -batch 200 -bvhAlgorithm ${algo}

 SplitLongestAxis:                                       | LargestDistanceAlongAxis                               | SurfaceAreaHeuristic
 ------------------------------------------------------- |--------------------------------------------------------|---------------------------------------------------------|
Initialization took: 28.7534 sec                         | Initialization took: 28.9388 sec                       | Initialization took: 28.7117 sec
INFO: capacity of containers set to 4194304              | INFO: capacity of containers set to 4194304            | INFO: capacity of containers set to 4194304
INFO: batching 200 particles for transport on the GPU    | INFO: batching 200 particles for transport on the GPU  | INFO: batching 200 particles for transport on the GPU
INFO: running with magnetic field OFF                    | INFO: running with magnetic field OFF                  | INFO: running with magnetic field OFF
                                                         |                                                        |
Simulating particles ... done!                           | Simulating particles ... done!                         | Simulating particles ... done!
Run time: 40.6881                                        | Run time: 37.099                                       | Run time: 36.3338
                                                         |                                                        |
                                                         |                                                        |
Mean energy deposit          10 GeV                      | Mean energy deposit          10 GeV                    | Mean energy deposit          10 GeV
Mean number of gamma         3685.24                     | Mean number of gamma         3685.54                   | Mean number of gamma         3685.29
Mean number of e-            12151.9                     | Mean number of e-            12153.6                   | Mean number of e-            12151.1
Mean number of e+            318.477                     | Mean number of e+            318.53                    | Mean number of e+            318.543
Mean number of charged steps 24397                       | Mean number of charged steps 24404.3                   | Mean number of charged steps 24399.4
Mean number of neutral steps 28200.7                     | Mean number of neutral steps 28236.2                   | Mean number of neutral steps 28229.7
Mean number of hits          18151.2                     | Mean number of hits          18191                     | Mean number of hits          18184.9
Edited by Stephan Hageboeck

Merge request reports