skip to main content
research-article

Rodent: generating renderers without writing a generator

Published:12 July 2019Publication History
Skip Abstract Section

Abstract

Monte-Carlo Renderers must generate many color samples to produce a noise-free image, and for each of those, they must evaluate complex mathematical models representing the appearance of the objects in the scene. These models are usually in the form of shaders: Small programs that are executed during rendering in order to compute a value for the current sample.

Renderers often compile and optimize shaders just before rendering, taking advantage of the knowledge of the scene. In principle, the entire renderer could benefit from a-priori code generation. For instance, scheduling can take advantage of the knowledge of the scene in order to maximize hardware usage. However, writing such a configurable renderer eventually means writing a compiler that translates a scene description into machine code.

In this paper, we present a framework that allows generating entire renderers for CPUs and GPUs without having to write a dedicated compiler: First, we provide a rendering library in a functional/imperative language that elegantly abstracts the individual rendering concepts using higher-order functions. Second, we use partial evaluation to combine and specialize the individual components of a renderer according to a particular scene.

Our results show that the renderers we generate outperform equivalent high-performance implementations written with state-of-the-art ray tracing libraries on the CPU and GPU.

Skip Supplemental Material Section

Supplemental Material

papers_190.mp4

References

  1. Attila T. Áfra, Carsten Benthin, Ingo Wald, and Jacob Munkberg. 2016. Local Shading Coherence Extraction for SIMD-efficient Path Tracing on CPUs. In Proceedings of High Performance Graphics. Eurographics Association, 119--128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. P.H. Andersen. 1995. Partial Evaluation Applied to Ray Tracing. DIKU Research Report 95/2. DIKU.Google ScholarGoogle Scholar
  3. Kenichi Asai. 2002. Can Partial Evaluation Improve the Performance of Ray Tracing? Technical Report Vol. 53, Nr. 1. Ochanomizu University. 97--100.Google ScholarGoogle Scholar
  4. Benedikt Bitterli. 2016. Rendering resources. https://benedikt-bitterli.me/resources/Google ScholarGoogle Scholar
  5. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. 2007. Finally Tagless, Partially Evaluated. In Programming Languages and Systems, 5th Asian Symposium, APLAS 2007, Singapore, November 29-December 1, 2007, Proceedings. 222--238. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Charles Consel. 1988. New Insights into Partial Evaluation: the SCHISM Experiment. In ESOP '88, 2nd European Symposium on Programming, Nancy, France, March 21--24, 1988, Proceedings. 236--246. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Döllner and K. Hinrichs. 2002. A Generic Rendering System. IEEE Transactions on Visualization and Computer Graphics 8, 2 (2002), 99--118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Philip Dutre, Paul Heckbert, Vincent Ma, Fabio Pellacini, Robert Porschka, Mahesh Ramasubramanian, Cyril Soler, and Greg Ward. 2001. Global Illumination Compendium.Google ScholarGoogle Scholar
  9. Yoshihiko Futamura. 1982. Parital Computation of Programs. In RIMS Symposium on Software Science and Engineering, Kyoto, Japan, 1982, Proceedings. 1--35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Iliyan Georgiev and Philipp Slusallek. 2008. RTfact: Generic Concepts for Flexible and High Performance Ray Tracing. In Proceedings of the IEEE Symposium on Interactive Ray Tracing (RT). IEEE, 115--122.Google ScholarGoogle ScholarCross RefCross Ref
  11. Andrew S. Glassner (Ed.). 1989. An Introduction to Ray Tracing. Academic Press Ltd., London, UK, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Brian Guenter, Todd B. Knoblock, and Erik Ruf. 1995. Specializing Shaders. In Proceedings of the 22Nd Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH '95). ACM, New York, NY, USA, 343--350. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Maurice H. Halstead. 1977. Elements of Software Science (Operating and Programming Systems Series). Elsevier Science Inc., New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Yong He, Kayvon Fatahalian, and Tim Foley. 2018. Slang: Language Mechanisms for Extensible Real-time Shading Systems. ACM Trans. Graph. 37, 4, Article 141 (2018), 13 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Neil D. Jones. 1996. An Introduction to Partial Evaluation. ACM Comput. Surv. 28, 3 (1996), 480--503. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. James T. Kajiya. 1986. The Rendering Equation. SIGGRAPH Comput. Graph. 20, 4 (1986), 143--150. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Samuli Laine, Tero Karras, and Timo Aila. 2013. Megakernels Considered Harmful: Wavefront Path Tracing on GPUs. In Proceedings of the 5th High-Performance Graphics Conference (HPG). ACM, 137--143. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Roland Leißa, Klaas Boesche, Sebastian Hack, Arsène Pérard-Gayot, Richard Membarth, Philipp Slusallek, André Müller, and Bertil Schmidt. 2018. AnyDSL: A Partial Evaluation Framework for Programming High-Performance Libraries. PACMPL 2, OOPSLA (2018), 119:1--119:30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Michael D. McCool, Zheng Qin, and Tiberiu S. Popa. 2002. Shader Metaprogramming. In Proceedings of the ACM SIGGRAPH/EUROGRAPHICS Conference on Graphics Hardware (HWWS '02). Eurographics Association, Aire-la-Ville, Switzerland, Switzerland, 57--68. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Simon Moll and Sebastian Hack. 2018. Partial Control-Flow Linearization. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). ACM, 543--556. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. NVIDIA. 2019. CUDA Toolkit Documentation. http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html, visited 10/01/19.Google ScholarGoogle Scholar
  22. 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 (TOG) 29, 4, Article 66 (July 2010), 13 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Matt Pharr and William R. Mark. 2012. ispc: A SPMD Compiler for High-Performance CPU Programming. In 2012 Innovative Parallel Computing (InPar). IEEE, 1--13.Google ScholarGoogle Scholar
  24. Pixar 1988. RenderMan Interface Specification. Pixar. version 3.0.Google ScholarGoogle Scholar
  25. Arsène Pérard-Gayot, Martin Weier, Richard Membarth, Philipp Slusallek, Roland Leißa, and Sebastian Hack. 2017. RaTrace: Simple and Efficient Abstractions for BVH Ray Traversal Algorithms. In Proceedings of the 16th International Conference on Generative Programming: Concepts & Experiences (GPCE). ACM, 157--168. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Jonathan Ragan-Kelley, Connelly Barnes, Andrew Adams, Sylvain Paris, Frédo Durand, and Saman Amarasinghe. 2013. Halide: A Language and Compiler for Optimizing Parallelism, Locality, and Recomputation in Image Processing Pipelines. SIGPLAN Not. 48, 6 (2013), 519--530. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. James Reinders. 2007. Intel Threading Building Blocks - Outfitting C++ for Multi-Core Processor Parallelism. O'Reilly. http://www.oreilly.com/catalog/9780596514808/index.html Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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
  29. Philipp Slusallek and Hans-Peter Seidel. 1995. Vision - An Architecture for Global Illumination Calculations. IEEE Transactions on Visualization & Computer Graphics 1 (1995), 77--96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Kristian Sons, Felix Klein, Jan Sutter, and Philipp Slusallek. 2014. shade.js: Adaptive Material Descriptions. Computer Graphics Forum 33, 7 (2014), 51--60. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Sony Pictures Imageworks 2017. Open Shading Language Specification. Sony Pictures Imageworks. version 1.9.Google ScholarGoogle Scholar
  32. Eric Veach and Leonidas J. Guibas. 1995. Optimally Combining Sampling Techniques for Monte Carlo Rendering. In Proceedings of the 22Nd Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH '95). ACM, New York, NY, USA, 419--428. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Ingo Wald, Sven Woop, Carsten Benthin, Gregory S. Johnson, and Manfred Ernst. 2014. Embree: A Kernel Framework for Efficient CPU Ray Tracing. ACM Transactions on Graphics (TOG) 33, 4, Article 143 (July 2014), 8 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Turner Whitted. 1980. An Improved Illumination Model for Shaded Display. Commun. ACM 23, 6 (1980), 343--349. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Stefan Zellmann, Daniel Wickeroth, and Ulrich Lang. 2017. Visionaray: A Cross-Platform Ray Tracing Template Library. In Proceedings of the 10th Workshop on Software Engineering and Architectures for Realtime Interactive Systems (IEEE SEARIS 2017). 1--8.Google ScholarGoogle ScholarCross RefCross Ref
  36. Yunming Zhang, Mengjiao Yang, Riyadh Baghdadi, Shoaib Kamil, Julian Shun, and Saman P. Amarasinghe. 2018. GraphIt: A High-Performance Graph DSL. PACMPL 2, OOPSLA (2018), 121:1--121:30. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Rodent: generating renderers without writing a generator

      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

      Full Access

      • Published in

        cover image ACM Transactions on Graphics
        ACM Transactions on Graphics  Volume 38, Issue 4
        August 2019
        1480 pages
        ISSN:0730-0301
        EISSN:1557-7368
        DOI:10.1145/3306346
        Issue’s Table of Contents

        Copyright © 2019 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: 12 July 2019
        Published in tog Volume 38, Issue 4

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader