Slide 1

Slide 1 text

Path Tracing Michael Fogleman September 2015 a.k.a. sweet graphics

Slide 2

Slide 2 text

The Code speakerdeck.com/fogleman github.com/fogleman/pt These Slides

Slide 3

Slide 3 text

Path tracing is a realistic rendering algorithm that simulates light bouncing around a scene.

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

“Global illumination” takes into account not only the light which comes directly from light sources (direct illumination), but also light rays that are reflected by other surfaces (indirect illumination). “Path tracing” falls under the umbrella of “global illumination” algorithms.

Slide 6

Slide 6 text

The “Rendering Equation” Uhh…

Slide 7

Slide 7 text

The “Rendering Equation” • Its own light output (emittance), and • The sum total of reflected light from all directions In layman’s terms, an object’s color depends on:

Slide 8

Slide 8 text

Monte Carlo • Path tracing is a randomized “Monte Carlo” algorithm • Simulate billions of random light rays bouncing around the scene • Hundreds or thousands of rays per pixel • Random = different results each time you run it • More rays = less noise in the image

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Basic Algorithm • For each pixel: • Cast a ray from the camera and through the pixel • Determine the nearest object in the scene that the ray intersects • Cast shadow ray(s) to determine direct lighting • Recursively cast more rays to determine indirect lighting, until some maximum depth is reached

Slide 11

Slide 11 text

Bounces (Recursion Depth)

Slide 12

Slide 12 text

Bounces: 0

Slide 13

Slide 13 text

Bounces: 1

Slide 14

Slide 14 text

Bounces: 2

Slide 15

Slide 15 text

Bounces: 3

Slide 16

Slide 16 text

Bounces: 4

Slide 17

Slide 17 text

Bounces: 8

Slide 18

Slide 18 text

Bounces: 16

Slide 19

Slide 19 text

Noise

Slide 20

Slide 20 text

Iterations: 1

Slide 21

Slide 21 text

Iterations: 2

Slide 22

Slide 22 text

Iterations: 4

Slide 23

Slide 23 text

Iterations: 8

Slide 24

Slide 24 text

Iterations: 16

Slide 25

Slide 25 text

Iterations: 64

Slide 26

Slide 26 text

Materials

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Diffuse Specular Glossy Tinted Clear Mirror

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Shapes • Spheres • Cubes • Triangles • Triangle Meshes • OBJ • STL

Slide 31

Slide 31 text

k-d tree

Slide 32

Slide 32 text

Textures

Slide 33

Slide 33 text

Examples

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

How does this differ from other rendering techniques?

Slide 41

Slide 41 text

OpenGL

Slide 42

Slide 42 text

Also OpenGL

Slide 43

Slide 43 text

Live Coding Demo