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.
Supplemental Material
Available for Download
Rodent is a BVH traversal library and renderer implemented using the AnyDSL compiler framework (https://anydsl.github.io/).The code is also available on GitHub: https://github.com/AnyDSL/rodent/releases/download/siggraph19/rodent_installer.zip
- 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 Scholar
Digital Library
- P.H. Andersen. 1995. Partial Evaluation Applied to Ray Tracing. DIKU Research Report 95/2. DIKU.Google Scholar
- Kenichi Asai. 2002. Can Partial Evaluation Improve the Performance of Ray Tracing? Technical Report Vol. 53, Nr. 1. Ochanomizu University. 97--100.Google Scholar
- Benedikt Bitterli. 2016. Rendering resources. https://benedikt-bitterli.me/resources/Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. Döllner and K. Hinrichs. 2002. A Generic Rendering System. IEEE Transactions on Visualization and Computer Graphics 8, 2 (2002), 99--118. Google Scholar
Digital Library
- Philip Dutre, Paul Heckbert, Vincent Ma, Fabio Pellacini, Robert Porschka, Mahesh Ramasubramanian, Cyril Soler, and Greg Ward. 2001. Global Illumination Compendium.Google Scholar
- Yoshihiko Futamura. 1982. Parital Computation of Programs. In RIMS Symposium on Software Science and Engineering, Kyoto, Japan, 1982, Proceedings. 1--35. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- Andrew S. Glassner (Ed.). 1989. An Introduction to Ray Tracing. Academic Press Ltd., London, UK, UK. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Maurice H. Halstead. 1977. Elements of Software Science (Operating and Programming Systems Series). Elsevier Science Inc., New York, NY, USA. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Neil D. Jones. 1996. An Introduction to Partial Evaluation. ACM Comput. Surv. 28, 3 (1996), 480--503. Google Scholar
Digital Library
- James T. Kajiya. 1986. The Rendering Equation. SIGGRAPH Comput. Graph. 20, 4 (1986), 143--150. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- NVIDIA. 2019. CUDA Toolkit Documentation. http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html, visited 10/01/19.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- Pixar 1988. RenderMan Interface Specification. Pixar. version 3.0.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Kristian Sons, Felix Klein, Jan Sutter, and Philipp Slusallek. 2014. shade.js: Adaptive Material Descriptions. Computer Graphics Forum 33, 7 (2014), 51--60. Google Scholar
Digital Library
- Sony Pictures Imageworks 2017. Open Shading Language Specification. Sony Pictures Imageworks. version 1.9.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Turner Whitted. 1980. An Improved Illumination Model for Shaded Display. Commun. ACM 23, 6 (1980), 343--349. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
Index Terms
Rodent: generating renderers without writing a generator
Recommendations
Fast, Realistic Lighting for Video Games
Global lighting effects produced by diffuse interreflections are typically simulated using global illumination methods such as radiosity or ray tracing. Although diffuse interreflections are crucial to produce realistic images, radiosity like methods ...
A fast relighting engine for interactive cinematic lighting design
SIGGRAPH '00: Proceedings of the 27th annual conference on Computer graphics and interactive techniquesWe present new techniques for interactive cinematic lighting design of complex scenes that use procedural shaders. Deep-framebuffers are used to store the geometric and optical information of the visible surfaces of an image. The geometric information ...





Comments