skip to main content
10.1145/3136040.3136044acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

RaTrace: simple and efficient abstractions for BVH ray traversal algorithms

Published:23 October 2017Publication History

ABSTRACT

In order to achieve the highest possible performance, the ray traversal and intersection routines at the core of every high-performance ray tracer are usually hand-coded, heavily optimized, and implemented separately for each hardware platform—even though they share most of their algorithmic core. The results are implementations that heavily mix algorithmic aspects with hardware and implementation details, making the code non-portable and difficult to change and maintain.

In this paper, we present a new approach that offers the ability to define in a functional language a set of conceptual, high-level language abstractions that are optimized away by a special compiler in order to maximize performance. Using this abstraction mechanism we separate a generic ray traversal and intersection algorithm from its low-level aspects that are specific to the target hardware. We demonstrate that our code is not only significantly more flexible, simpler to write, and more concise but also that the compiled results perform as well as state-of-the-art implementations on any of the tested CPU and GPU platforms.

References

  1. Timo Aila and Samuli Laine. 2009. Understanding the Efficiency of Ray Traversal on GPUs. In Proceedings of the Conference on HighPerformance Graphics (HPG). ACM, 145–149. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Timo Aila, Samuli Laine, and Tero Karras. 2012. Understanding the Efficiency of Ray Traversal on GPUs - Kepler and Fermi Addendum. Technical Report NVR-2012-002. NVIDIA Technical Report.Google ScholarGoogle Scholar
  3. L.O Andersen. 1994. Program Analysis and Specialization for the C Programming Language. Ph.D. Dissertation. Københavns Universitet. Datalogisk Institut.Google ScholarGoogle Scholar
  4. P.H. Andersen. 1995. Partial Evaluation Applied to Ray Tracing. DIKU Research Report 95/2.Google ScholarGoogle Scholar
  5. Rasmus Barringer and Tomas Akenine-Möller. 2014. Dynamic Ray Stream Traversal. ACM Trans. Graph. 33, 4, Article 151 (2014), 9 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Carsten Benthin and Ingo Wald. 2009. Efficient Ray Traced Soft Shadows using Multi-Frusta Tracing. In High-Performance Graphics. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Carsten Benthin, Ingo Wald, Sven Woop, Manfred Ernst, and William R. Mark. 2012. Combining Single and Packet-Ray Tracing for Arbitrary Ray Distributions on the Intel MIC Architecture. IEEE Transactions on Visualization and Computer Graphics 18, 9 (2012), 1438–1448. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Kevin J. Brown, Arvind K. Sujeeth, HyoukJoong Lee, Tiark Rompf, Hassan Chafi, Martin Odersky, and Kunle Olukotun. 2011. A Heterogeneous Parallel Framework for Domain-Specific Languages. In 12th International Conference on Parallel Architectures and Compilation Techniques (PACT). 89–100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. 2009. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. J. Funct. Program. 19, 5 (2009), 509–543. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Hassan Chafi, Zach DeVito, Adriaan Moors, Tiark Rompf, Arvind K. Sujeeth, Pat Hanrahan, Martin Odersky, and Kunle Olukotun. 2010. Language virtualization for heterogeneous parallel computing. In Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA). 835– 847. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Charisee Chiw, Gordon Kindlmann, John Reppy, Lamont Samuels, and Nick Seltzer. 2012. Diderot: A Parallel DSL for Image Analysis and Visualization. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). ACM, 111–120. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Robert L. Cook, Thomas Porter, and Loren Carpenter. 1984. Distributed Ray Tracing. SIGGRAPH Comput. Graph. 18, 3 (1984), 137–145. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Holger Dammertz, Johannes Hanika, and Alexander Keller. 2008. Shallow Bounding Volume Hierarchies for Fast SIMD Ray Tracing of Incoherent Rays. In Proceedings of the Nineteenth Eurographics Conference on Rendering. Eurographics Association, 1225–1233. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Zach DeVito, Niels Joubert, Francisco Palacios, Stephen Oakley, Montserrat Medina, Mike Barrientos, Erich Elsen, Frank Ham, Alex Aiken, Karthik Duraisamy, Eric Darve, Juan Alonso, and Pat Hanrahan. 2011. Liszt: a domain specific language for building portable mesh-based PDE solvers. In Conference on High Performance Computing Networking, Storage and Analysis (SC). 9:1–9:12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Tim Foley and Jeremy Sugerman. 2005. KD-tree Acceleration Structures for a GPU Raytracer. In Proceedings of the ACM SIGGRAPH/EU-ROGRAPHICS Conference on Graphics Hardware. ACM, 15–22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Iliyan Georgiev and Philipp Slusallek. 2008. RTfact: Generic Concepts for Flexible and High Performance Ray Tracing. In IEEE Symposium on Interactive Ray Tracing (RT). 115–122. Google ScholarGoogle ScholarCross RefCross Ref
  17. Johannes Gunther, Stefan Popov, Hans-Peter Seidel, and Philipp Slusallek. 2007. Realtime Ray Tracing on GPU with BVH-based Packet Traversal. In Proceedings of the 2007 IEEE Symposium on Interactive Ray Tracing. 113–118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Maurice H. Halstead. 1977. Elements of Software Science (Operating and Programming Systems Series). Elsevier Science Inc.Google ScholarGoogle Scholar
  19. Christian Hofer, Klaus Ostermann, Tillmann Rendel, and Adriaan Moors. 2008. Polymorphic embedding of DSLs. In Proceedings of the 7th International Conference on Generative Programming and Component Engineering (GPCE). 137–148. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Daniel Reiter Horn, Jeremy Sugerman, Mike Houston, and Pat Hanrahan. 2007. Interactive K-d Tree GPU Raytracing. In Proceedings of the Symposium on Interactive 3D Graphics and Games. ACM, 167–174. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. Hudak. 1998. Modular Domain Specific Languages and Tools. In Proceedings of the 5th International Conference on Software Reuse (ICSR). IEEE Computer Society, 134–. http://dl.acm.org/citation.cfm? id=551789.853532Google ScholarGoogle ScholarCross RefCross Ref
  22. Timothy L. Kay and James T. Kajiya. 1986. Ray Tracing Complex Scenes. SIGGRAPH Comput. Graph. 20, 4 (1986), 269–278. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Roland Leißa, Klaas Boesche, Sebastian Hack, Richard Membarth, and Philipp Slusallek. 2015. Shallow Embedding of DSLs via Online Partial Evaluation. In Proceedings of the 14th International Conference on Generative Programming: Concepts & Experiences (GPCE). ACM, 11–20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Roland Leißa, Marcel Köster, and Sebastian Hack. 2015. A GraphBased Higher-Order Intermediate Representation. In International Symposium on Code Generation and Optimization (CGO). IEEE, 202–212. Google ScholarGoogle ScholarCross RefCross Ref
  25. Richard Membarth, Oliver Reiche, Frank Hannig, Jürgen Teich, Mario Körner, and Wieland Eckert. 2016. HIPA cc : A Domain-Specific Language and Compiler for Image Processing. IEEE Trans. Parallel Distrib. Syst. 27, 1 (2016), 210–224. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Tomas Möller and Ben Trumbore. 1997. Fast, Minimum Storage RayTriangle Intersection. J. Graphics, GPU, & Game Tools 2, 1 (1997). Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Chris J. Newburn, Byoungro So, Zhenying Liu, Michael D. McCool, Anwar M. Ghuloum, Stefanus Du Toit, Zhi-Gang Wang, Zhaohui Du, Yongjian Chen, Gansha Wu, Peng Guo, Zhanglin Liu, and Dan Zhang. 2011. Intel’s Array Building Blocks: A retargetable, dynamic compiler and embedded language. In Proceedings of the 9th International Symposium on Code Generation and Optimization (CGO). 224–235. Google ScholarGoogle ScholarCross RefCross Ref
  28. NVIDIA. 2014. Whitepaper: NVIDIA GeForce GTX 980. Technical Report. NVIDIA Corporation.Google ScholarGoogle Scholar
  29. Georg Ofenbeck, Tiark Rompf, Alen Stojanov, Martin Odersky, and Markus Püschel. 2013. Spiral in Scala: Towards the Systematic Construction of Generators for Performance Libraries. In International Conference on Generative Programming: Concepts & Experiences (GPCE). 125–134. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Steven Parker, William Martin, Peter-Pike J. Sloan, Peter Shirley, Brian Smits, and Charles Hansen. 1999. Interactive Ray Tracing. In Proceedings of the Symposium on Interactive 3D Graphics. ACM, 119–126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Steven G. Parker, James Bigler, Andreas Dietrich, Heiko Friedrich, Jared Hoberock, David Luebke, David McAllister, Morgan McGuire, Keith Morley, Austin Robison, and Martin Stich. 2010. OptiX: A General Purpose Ray Tracing Engine. ACM Transactions on Graphics (2010). Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Pharr and W. R. Mark. 2012. ispc: A SPMD Compiler for HighPerformance CPU Programming. In In Proceedings of Innovative Parallel Computing (InPar). Google ScholarGoogle ScholarCross RefCross Ref
  33. Jonathan Ragan-Kelley, Connelly Barnes, Andrew Adams, Sylvain Paris, Frédo Durand, and Saman P. Amarasinghe. 2013. Halide: a language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 519–530. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Alexander Reshetov, Alexei Soupikov, and Jim Hurley. 2005. Multi-level Ray Tracing Algorithm. ACM Trans. Graph. 24, 3 (2005), 1176–1185. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Tiark Rompf and Martin Odersky. 2010. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs. In Proceedings of the 10th International Conference on Generative Programming and Component Engineering (GPCE). 127–136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Kai Selgrad, Alexander Lier, Franz Köferl, Marc Stamminger, and Daniel Lohmann. 2015. Lightweight, Generative Variant Exploration for High-performance Graphics Applications. In Proceedings of the 14th International Conference on Generative Programming: Concepts & Experiences (GPCE). ACM, 141–150. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Martin Stich, Heiko Friedrich, and Andreas Dietrich. 2009. Spatial Splits in Bounding Volume Hierarchies. In Proceedings of the Conference on High-Performance Graphics (HPG). ACM, 7–13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Arvind K. Sujeeth, HyoukJoong Lee, Kevin J. Brown, Tiark Rompf, Hassan Chafi, Michael Wu, Anand R. Atreya, Martin Odersky, and Kunle Olukotun. 2011. OptiML: An Implicitly Parallel Domain-Specific Language for Machine Learning. In Proceedings of the 28th International Conference on Machine Learning (ICML). 609–616.Google ScholarGoogle Scholar
  39. John A. Tsakok. 2009. Faster Incoherent Rays: Multi-BVH Ray Stream Tracing. In Proceedings of the Conference on High-Performance Graphics (HPG). ACM, 151–158. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Ingo Wald. 2005. The OpenRT-API. In ACM SIGGRAPH Courses. ACM, Article 21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Ingo Wald, Carsten Benthin, and Solomon Boulos. 2008. Getting rid of packets: Efficient SIMD single-ray traversal using multibranching BVHs. In IEEE/Eurographics Symposium on Interactive Ray Tracing. 49–57. Google ScholarGoogle ScholarCross RefCross Ref
  42. Ingo Wald, Philipp Slusallek, Carsten Benthin, and Markus Wagner. 2001. Interactive Rendering with Coherent Ray Tracing. Computer Graphics Forum (2001). Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Ingo Wald, Sven Woop, Carsten Benthin, Gregory S. Johnson, and Manfred Ernst. 2014. Embree: A Kernel Framework for Efficient CPU Ray Tracing. ACM Trans. Graph. 33, 4, Article 143 (2014), 8 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Sven Woop. 2004. A Ray Tracing Hardware Architecture for Dynamic Scenes. Technical Report. Saarland University.Google ScholarGoogle Scholar

Index Terms

  1. RaTrace: simple and efficient abstractions for BVH ray traversal algorithms

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        GPCE 2017: Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
        October 2017
        258 pages
        ISBN:9781450355247
        DOI:10.1145/3136040
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 52, Issue 12
          GPCE '17
          December 2017
          258 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/3170492
          Issue’s Table of Contents

        Copyright © 2017 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 23 October 2017

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate56of180submissions,31%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader