pbrt-v3 tutorialvda.univie.ac.at/.../17w/lecturenotes/tutorial-v3.pdf · 2017. 10. 5. · pbrt-v3...

12
© Alireza Ghane PBRT-v3 Tutorial 052213 Image Synthesis Alireza Ghane [email protected]

Upload: others

Post on 18-Aug-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© Alireza Ghane

PBRT-v3 Tutorial

052213 Image Synthesis

Alireza [email protected]

Page 2: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© 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

Page 3: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© 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

Page 4: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© Alireza Ghane

System Overview

4

Page 5: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© 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

Page 6: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© Alireza Ghane

Abstract Base Classes

6

Page 7: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© 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

Page 8: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© Alireza Ghane

The Renderer• Major components that traces rays• Multithreaded using scene-space decomposition

8

Page 9: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© 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

Page 10: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© 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

Page 11: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© 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

Page 12: PBRT-v3 Tutorialvda.univie.ac.at/.../17w/LectureNotes/tutorial-v3.pdf · 2017. 10. 5. · PBRT-v3 Tutorial 052213 Image Synthesis ... • Well documented in a literate programming

© Alireza Ghane

Questions?

12