Slide 1

Slide 1 text

Three Papers on Illumination 1

Slide 2

Slide 2 text

Who am I? • Engineer at Two Sigma working on distributed systems problems • Studied computer graphics in school • Just got a kitten, she is adorable 2

Slide 3

Slide 3 text

The views expressed herein are not necessarily the views of Two Sigma Investments, LP or any of its affiliates (collectively, “Two Sigma”). The information presented herein is only for informational and educational purposes and is not an offer to sell or the solicitation of an offer to buy any securities or other instruments. Additionally, the information is not intended to provide, and should not be relied upon for investment, accounting, legal or tax advice. Two Sigma makes no representations, express or implied, regarding the accuracy or completeness of this information, and you accept all risks in relying on the above information for any purpose whatsoever. Important Legal Information 3

Slide 4

Slide 4 text

What we are trying to do By Gilles Tran - http://www.oyonale.com/modeles.php?lang=en&page=40, Public Domain, https://commons.wikimedia.org/w/index.php?curid=745313 4

Slide 5

Slide 5 text

Lighting effects – diffuse 5

Slide 6

Slide 6 text

Lighting effects – specular 6

Slide 7

Slide 7 text

Lighting effects – (soft) shadows 7

Slide 8

Slide 8 text

Lighting effects – refraction and reflection 8

Slide 9

Slide 9 text

Lighting effects – caustics http://madebyevan.com/webgl-water 9

Slide 10

Slide 10 text

Lighting effects – color bleed http://madebyevan.com/webgl-path-tracing/ 10

Slide 11

Slide 11 text

What we are going to talk about • Background • Continuous shading of curved surfaces – Henri Gouraud • An Improved Illumination Model for Shaded Display – Turner Whitted • The Rendering equation – James T. Kajiya 11

Slide 12

Slide 12 text

The model 12

Slide 13

Slide 13 text

3d scenes Mesh of triangles Functions https://www.shadertoy.com/view/4sS3zG 13

Slide 14

Slide 14 text

Rendering Items first for each item for each pixel if pixel between eye and item draw something here Pixels first for each pixel for each item if ray from eye through pixel hits item draw something here 14

Slide 15

Slide 15 text

Some math, Vectors and Rays Direction and magnitude Starting point and direction Vector Ray 15

Slide 16

Slide 16 text

Some math, Normals N N 16

Slide 17

Slide 17 text

Lighting models (, %) X’ x L 17

Slide 18

Slide 18 text

Lighting models – Lambert cosine law Incoming light Outgoing light ∗ = cos ( ℎ ) Constant (viewer independent) 18

Slide 19

Slide 19 text

19

Slide 20

Slide 20 text

Machbanding By The original uploader was Aliwiki at French Wikipedia - Transferred from fr.wikipedia to Commons by Korrigan using CommonsHelper., FAL, https://commons.wikimedia.org/w/index.php?curid=4770182 20

Slide 21

Slide 21 text

Mach bands 21

Slide 22

Slide 22 text

Its 1971… We are here 22

Slide 23

Slide 23 text

Put it in hardware! 23

Slide 24

Slide 24 text

for each triangle for each row in image for each col in row if pixel between eye and item draw something here Hidden surface removal problem 1-100 ~400 ~600 O(T*H*W) 24

Slide 25

Slide 25 text

Hidden surface removal (simple) *Project triangles into screen space* for each row in image for each triangle if row intersects triangle line segments for col between intersected line segments draw something here* * Consider depth 25

Slide 26

Slide 26 text

Gouraud Illumination model = < + ? @ A B B∈EFGHIJ N L 26

Slide 27

Slide 27 text

The one cool trick… A B C row 27

Slide 28

Slide 28 text

How well does it work? 28

Slide 29

Slide 29 text

29

Slide 30

Slide 30 text

Reflection 30

Slide 31

Slide 31 text

Refraction By JrPol - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/i ndex.php?curid=38535231 By Josell7 - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curi d=21670922 31

Slide 32

Slide 32 text

The model = < + ? @ A B B∈EFGHIJ + J + I 32

Slide 33

Slide 33 text

The model 33

Slide 34

Slide 34 text

Ray tracing By Henrik - Own work, GFDL, https://commons.wikimedia.org/w/index.php?curid=3869326 34

Slide 35

Slide 35 text

35

Slide 36

Slide 36 text

36

Slide 37

Slide 37 text

37

Slide 38

Slide 38 text

38

Slide 39

Slide 39 text

The rendering equation , % = , % , % + N , %, %% %, %% ′′ Q 39

Slide 40

Slide 40 text

The rendering equation , % = , % , % + N , %, %% %, %% ′′ Q 40

Slide 41

Slide 41 text

, % = , % , % + N , %, %% %, %% ′′ Q The rendering equation 41

Slide 42

Slide 42 text

, % = , % , % + N , %, %% %, %% ′′ Q The rendering equation 42

Slide 43

Slide 43 text

The rendering equation , % = , % , % + N , %, %% %, %% ′′ Q 43

Slide 44

Slide 44 text

The rendering equation , % = , % , % + N , %, %% %, %% ′′ Q 44

Slide 45

Slide 45 text

Approximation 45

Slide 46

Slide 46 text

Approximation 46

Slide 47

Slide 47 text

Previous methods as approximation 47

Slide 48

Slide 48 text

Previous methods as approximation 48

Slide 49

Slide 49 text

Integration 49

Slide 50

Slide 50 text

Expectation = N () = N 50

Slide 51

Slide 51 text

Expectation = N ≈ 1 @ F W FXY () = N ≈ 1 @ (F ) W FXY 51

Slide 52

Slide 52 text

Monte Carlo integration N 52

Slide 53

Slide 53 text

Monte Carlo integration N = N 53

Slide 54

Slide 54 text

Monte Carlo integration N = N = 54

Slide 55

Slide 55 text

Monte Carlo integration N = N = () = N Where = () 55

Slide 56

Slide 56 text

Monte Carlo integration N = N = () = N Where = () ≈ 1 @ F (F ) W FXY 56

Slide 57

Slide 57 text

Monte Carlo integration example 57

Slide 58

Slide 58 text

Monte Carlo Integration + Rendering Equation N , %, %% %, %% ′′ Q X’ 58

Slide 59

Slide 59 text

Path Tracing X’ 59

Slide 60

Slide 60 text

Variance reduction 60

Slide 61

Slide 61 text

Path tracing example 61

Slide 62

Slide 62 text

Summary 1. Continuous shading of curved surfaces – Henri Gouraud 2. An Improved Illumination Model for Shaded Display – Turner Whitted 3. The Rendering equation – James T. Kajiya = < + ? @ A B B∈EFGHIJ , % = , % , % + N , %, %% %, %% ′′ Q = < + ? @ A B + J + I B∈EFGHIJ 62

Slide 63

Slide 63 text

Thank you Andy van Dam John “Spike” Hughes 63