The Visual Computer

, Volume 32, Issue 6–8, pp 977–987 | Cite as

Parallel BVH construction using k-means clustering

  • Daniel MeisterEmail author
  • Jiří Bittner
Original Article


We propose a novel method for fast parallel construction of bounding volume hierarchies (BVH) on the GPU. Our method is based on a combination of divisible and agglomerative clustering. We use the k-means algorithm to subdivide scene primitives into clusters. From these clusters, we construct treelets using the agglomerative clustering algorithm. Applying this procedure recursively, we construct the entire bounding volume hierarchy. We implemented the method using parallel programming concepts on the GPU. The results show the versatility of the method: it can be used to construct medium-quality hierarchies very quickly, but also it can be used to construct high-quality hierarchies given a slightly longer computational time. We evaluate the method in the context of GPU ray tracing and show that it provides results comparable with other state-of-the-art GPU techniques for BVH construction. We also believe that our approach based on the k-means algorithm gives a new insight into how bounding volume hierarchies can be constructed.


Ray tracing Object hierarchies  Three-dimensional graphics Realism 



This research was supported by the Czech Science Foundation under Research Program P202/12/2413 (Opalis) and the Grant Agency of the Czech Technical University in Prague, Grant No. SGS16/237/OHK3/3T/13.

Supplementary material

Supplementary material 1 (avi 28465 KB)


  1. 1.
    Aila, T., Karras, T., Laine, S.: On quality metrics of bounding volume hierarchies. In: Proceedings of High Performance Graphics, pp. 101–108. ACM, New York (2013)Google Scholar
  2. 2.
    Aila, T., Laine, S.: Understanding the efficiency of ray traversal on GPUs. In: Proceedings of HPG, pp. 145–149 (2009)Google Scholar
  3. 3.
    Apetrei, C.: Fast and simple agglomerative LBVH construction. In: Borgo, R., Tang, W. (eds.) Computer Graphics and Visual Computing (CGVC). The Eurographics Association (2014). doi: 10.2312/cgvc.20141206
  4. 4.
    Arthur, D., Vassilvitskii, S.: \(K\)-means++: the advantages of careful seeding. In: Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’07), pp. 1027–1035. Society for Industrial and Applied Mathematics, Philadelphia (2007)Google Scholar
  5. 5.
    Bittner, J., Hapala, M., Havran, V.: Fast insertion-based optimization of bounding volume hierarchies. Comput. Graph. Forum 32(1), 85–100 (2013)CrossRefGoogle Scholar
  6. 6.
    Bittner, J., Havran, V.: RDH: ray distribution heuristics for construction of spatial data structures. In: Proceedings of SCCG, pp. 61–67. ACM, New York (2009)Google Scholar
  7. 7.
    Dammertz, H., Hanika, J., Keller, A.: Shallow bounding volume hierarchies for fast SIMD ray tracing of incoherent rays. Comput. Graph. Forum 27, 1225–1233(9) (2008)CrossRefGoogle Scholar
  8. 8.
    Dasgupta, S.: The hardness of \(k\)-means clustering. Department of Computer Science and Engineering, University of California, San Diego (2008)Google Scholar
  9. 9.
    Domingues, L.R., Pedrini, H.: Bounding volume hierarchy optimization through agglomerative treelet restructuring. In: Proceedings of the 7th Conference on High-Performance Graphics, pp. 13–20 (2015)Google Scholar
  10. 10.
    Fabianowski, B., Fowler, C., Dingliana, J.: A cost metric for scene-interior ray origins. In: Eurographics, Short Papers, pp. 49–52 (2009)Google Scholar
  11. 11.
    Feltman, N., Lee, M., Fatahalian, K.: SRDH: specializing BVH construction and traversal order using representative shadow ray sets. In: Proceedings of HPG, pp. 49–55 (2012)Google Scholar
  12. 12.
    Ganestam, P., Barringer, R., Doggett, M., Akenine-Möller, T.: Bonsai: rapid bounding volume hierarchy generation using mini trees. J. Comput. Graph. Tech. (JCGT) 4(3), 23–42 (2015)Google Scholar
  13. 13.
    Garanzha, K., Pantaleoni, J., McAllister, D.: Simpler and faster HLBVH with work queues. In: Proceedings of HPG’11, pp. 59–64. ACM SIGGRAPH/Eurographics, Vancouver (2011)Google Scholar
  14. 14.
    Goldsmith, J., Salmon, J.: Automatic creation of object hierarchies for ray tracing. IEEE Comput. Graph. Appl. 7(5), 14–20 (1987)CrossRefGoogle Scholar
  15. 15.
    Gu, Y., He, Y., Fatahalian, K., Blelloch, G.E.: Efficient BVH construction via approximate agglomerative clustering. In: Proceedings of high performance graphics, pp. 81–88. ACM, New York (2013)Google Scholar
  16. 16.
    Havran, V., Herzog, R., Seidel, H.P.: On the fast construction of spatial data structures for ray tracing. Proc. IEEE Symp. Interact. Ray Tracing 2006, 71–80 (2006)CrossRefGoogle Scholar
  17. 17.
    Hunt, W.: Corrections to the surface area metric with respect to mail-boxing. In: IEEE Symposium on Interactive Ray Tracing (RT’08), pp. 77–80 (2008)Google Scholar
  18. 18.
    Hunt, W., Mark, W.R., Fussell, D.: Fast and lazy build of acceleration structures from scene hierarchies. In: Proceedings of Symposium on Interactive Ray Tracing, pp. 47–54 (2007)Google Scholar
  19. 19.
    Ize, T., Wald, I., Parker, S.G.: Asynchronous BVH construction for ray tracing dynamic scenes on parallel multi-core architectures. In: Proceedings of Symposium on Parallel Graphics and Visualization’07, pp. 101–108 (2007)Google Scholar
  20. 20.
    Jain, A.K., Dubes, R.C.: Algorithms for Clustering Data. Prentice-Hall Inc, Upper Saddle River (1988)zbMATHGoogle Scholar
  21. 21.
    Karras, T.: Maximizing parallelism in the construction of BVHs, octrees, and k-d trees. In: Proceedings of High Performance Graphics, pp. 33–37 (2012)Google Scholar
  22. 22.
    Karras, T., Aila, T.: Fast Parallel construction of high-quality bounding volume hierarchies. In: Proceedings of High Performance Graphics, pp. 89–100. ACM, New York (2013)Google Scholar
  23. 23.
    Kay, T.L., Kajiya, J.T.: Ray tracing complex scenes. In: Evans, D.C., Athay, R.J. (eds.) SIGGRAPH ’86 Proceedings, vol. 20, pp. 269–278 (1986)Google Scholar
  24. 24.
    Kensler, A.: Tree rotations for improving bounding volume hierarchies. In: Proceedings of the 2008 IEEE Symposium on Interactive Ray Tracing, pp. 73–76 (2008)Google Scholar
  25. 25.
    Krivánek, M., Morávek, J.: NP-hard problems in hierarchical-tree clustering. Acta Inf. 23(3), 311–323 (1986)MathSciNetCrossRefzbMATHGoogle Scholar
  26. 26.
    Lauterbach, C., Garland, M., Sengupta, S., Luebke, D., Manocha, D.: Fast BVH construction on GPUs. Comput. Graph. Forum 28(2), 375–384 (2009)CrossRefGoogle Scholar
  27. 27.
    Lloyd, S.: Least squares quantization in PCM. IEEE Trans. Inf. Theor. 28(2), 129–137 (1982)MathSciNetCrossRefzbMATHGoogle Scholar
  28. 28.
    MacQueen, J.: Some methods for classification and analysis of multivariate observations. In: Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability. Volume 1: Statistics, pp. 281–297. University of California Press, Berkeley (1967)Google Scholar
  29. 29.
    Nickolls, J., Buck, I., Garland, M., Skadron, K.: Scalable parallel programming with CUDA. Queue 6(2), 40–53 (2008)CrossRefGoogle Scholar
  30. 30.
    Pantaleoni, J., Luebke, D.: HLBVH: hierarchical LBVH construction for real-time ray tracing of dynamic geometry. In: Proceedings of High Performance Graphics’10, pp. 87–95 (2010)Google Scholar
  31. 31.
    Rubin, S.M., Whitted, T.: A 3-dimensional representation for fast rendering of complex scenes. In: SIGGRAPH’80 Proceedings, vol. 14, pp. 110–116 (1980)Google Scholar
  32. 32.
    Vinkler, M., Bittner, J., Havran, V., Hapala, M.: Massively parallel hierarchical scene processing with applications in rendering. Comput. Graph. Forum 32(8), 13–25 (2013)CrossRefGoogle Scholar
  33. 33.
    Wald, I.: On fast construction of SAH based bounding volume hierarchies. In: Proceedings of the Symposium on Interactive Ray Tracing, pp. 33–40 (2007)Google Scholar
  34. 34.
    Wald, I.: Fast construction of SAH BVHs on the Intel many integrated core (MIC) architecture. IEEE Trans. Vis. Comput. Graph. 18(1), 47–57 (2012)MathSciNetCrossRefGoogle Scholar
  35. 35.
    Walter, B., Bala, K., Kulkarni, M., Pingali, K.: Fast agglomerative clustering for rendering. In: IEEE Symposium on Interactive Ray Tracing, pp. 81–86 (2008)Google Scholar
  36. 36.
    Weghorst, H., Hooper, G., Greenberg, D.P.: Improved computational methods for ray tracing. ACM Trans. Graph. 3(1), 52–69 (1984)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2016

Authors and Affiliations

  1. 1.Faculty of Electrical EngineeringCzech Technical University in PraguePragueCzech Republic

Personalised recommendations