15
1 CS-C3100 Computer Graphics 13.1 A simple shading model for Ray Tracing Jaakko Lehtinen with lots of material from Frédo Durand Henrik Wann Jensen

CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

1

CS-C3100 Computer Graphics 13.1 A simple shading model for Ray Tracing

Jaakko Lehtinen with lots of material from Frédo Durand

Hen

rik W

ann

Jens

en

Page 2: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

In This Video

2

• A simple shading model for a simple ray tracer – Point-light illumination – Shadows – Reflections – Refractions

NVIDIA

Page 3: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

3

Today – Ray Tracing(Indirect illumination)

Shadows

ReflectionsRefractions

(Caustics)

Hen

rik W

ann

Jens

en

Page 4: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

A Very Simple Shading Model

4

• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for

Shaded Display, Comm. ACM, 1980

• Just for illustration really, we’ll be looking at other models shortly

RoRd

N

Page 5: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

A Very Simple Shading Model

5

• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for

Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...

RoRd

NL

direct lightingI = kd max(0,L ·N)V (L)

Page 6: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

A Very Simple Shading Model

6

• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for

Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...

RoRd

NLR

+ ks I(R)I = kd kl max(0,L · N)

mirror reflection

direct lightingI = kd max(0,L ·N)V (L)

Page 7: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

A Very Simple Shading Model

7

• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for

Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...

RoRd

NLR

T

+ ks I(R)+ kt I(T )

I = kd kl max(0,L · N)mirror reflection

mirror refraction

direct lightingI = kd max(0,L ·N)V (L)

Page 8: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

+ ks I(R)

A Very Simple Shading Model

8

• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for

Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...

RoRd

NLR

T

+ kt I(T )

I(R) is light from mirror direction R I(T) is refracted light from direction T kd, ks, and kt are diffuse, specular and refraction coefficients

I = kd kl max(0,L · N)mirror reflection

mirror refraction

direct lightingI = kd max(0,L ·N)V (L)

Page 9: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

Our Placeholder Model

9

• V(L) is visibility of light source (0 or 1) • kd, ks, kt are material properties

– ka global constant, kl is light color • We are ignoring (e.g.)

– Specular reflection from the light (only diffuse N.L) – Distance falloff (only angle of normal and L)

+ ks I(R)+ kt I(T )

kd = diffuse coefficient (“color”)

ks = specular coefficient (“color”)

kt mirror refraction coefficient

+ kd ka ambient lighting

I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)

Page 10: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

Where Do These Come From?

10

• “Light incident from reflected direction” • “Light incident from refracted direction” • Light going towards the camera

• We’ll recurse and use the same function again

+ ks I(R)+ kt I(T )

kd = diffuse coefficient (“color”)

ks = specular coefficient (“color”)

kt mirror refraction coefficient

+ kd ka ambient lighting

I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)

Page 11: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

Where Do These Come From?

10

• “Light incident from reflected direction” • “Light incident from refracted direction” • Light going towards the camera

• We’ll recurse and use the same function again

+ ks I(R)+ kt I(T )

kd = diffuse coefficient (“color”)

ks = specular coefficient (“color”)

kt mirror refraction coefficient

+ kd ka ambient lighting

I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)

Page 12: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

Where Do These Come From?

10

• “Light incident from reflected direction” • “Light incident from refracted direction” • Light going towards the camera

• We’ll recurse and use the same function again

+ ks I(R)+ kt I(T )

kd = diffuse coefficient (“color”)

ks = specular coefficient (“color”)

kt mirror refraction coefficient

+ kd ka ambient lighting

I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)

Page 13: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

What Does It Look Like?

11

Turner Whitted

Page 14: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

Good Read!

12

Turner Whitted thinks back to the days of his discovery

Page 15: CS-C3100 Computer Graphics 13.1 A simple shading model ...lehtinj7/CS-C3100/2020/slides/13...A Very Simple Shading Model 4 • A subset of “Whitted ray tracing” – Turner Whitted,

What Does It Look Like?

13

Simple NVIDIA Optix sample