pbrt-v3 tutorialvda.univie.ac.at/.../17w/lecturenotes/tutorial-v3.pdf · 2017. 10. 5. · pbrt-v3...
TRANSCRIPT
© Alireza Ghane
What is PBRT?
• A physically based rendering system based on the ray-tracing algorithm– Think in terms of physical quantities and units
• Well documented in a literate programming style– Theory is coupled with implementation– Highly cross-referenced content– Book serves as API documentation
2
© Alireza Ghane
Working with PBRT
3
Pros Cons‣ Flexible and well-tested
framework‣ Saves your the pain of
writing bootstrapping code‣ Abstract and modular
design, so you can focus on certain aspects of interest
‣ Learning curve!‣ Basic design is already
set, can be hard to modify
© Alireza Ghane
System Overview
4
© Alireza Ghane
Scene Description File• Used to describe the geometry and lighting
with .pbrt file extension
5
Can edit scene manually •Support for various geometry primitives (sphere, quadrics, triangle meshes, etc.) and materials•Or export from a modelling software
•Scripts included for 3ds Max, Blender, Mathematica and Structure Synth
© Alireza Ghane
Abstract Base Classes
6
© Alireza Ghane
.pbrt File Format
• Specific scene using directives and identifiers along with parameters
• Identifiers correspond to class names• System takes care of parsing and
instantiating appropriate objects• More details in Appendix B• Also see
http://pbrt.org/users-guide.html
7
© Alireza Ghane
The Renderer• Major components that traces rays• Multithreaded using scene-space decomposition
8
© Alireza Ghane
Output Image• High Dynamic Range (HDR) image
analogous to the rat output of a camera• Saved in OpenEXR format• Has to be suitably tone-mapped for a
computer screen– View using exrdisplay– Convert to another format with exttopng, exr2tiff, …
9
© Alireza Ghane
How to get your feet wet• Download the code from
http://pbrt.org
• Build makefile with CMake• Download scenes from the scenes
repository (in http://pbrt.org)• You can modify the .pbrt file to modify
the scene
10
© Alireza Ghane
How to Extend PBRT
• Extend the appropriate classes (e.g. Ripples2DTexture that extends Texture)
• Provide instantiation code that extracts parameters and invokes the constructor (e.g. CreateRipplesFloatTexture)
• Add calls in the appropriate Make function in core/api.cpp (e.g. MakeFloatTexture)
11
© Alireza Ghane
Questions?
12