Materials & Shading CPSC 453 Fall 2018 Sonny Chan Materials - - PowerPoint PPT Presentation

materials shading
SMART_READER_LITE
LIVE PREVIEW

Materials & Shading CPSC 453 Fall 2018 Sonny Chan Materials - - PowerPoint PPT Presentation

Materials & Shading CPSC 453 Fall 2018 Sonny Chan Materials Rendered by Unreal Engine The appearance of a material is determined by the manner in which light is reflected from it, or transmitted through it. What is the most basic


slide-1
SLIDE 1

Materials & Shading

CPSC 453 – Fall 2018 Sonny Chan

slide-2
SLIDE 2

Materials

Rendered by Unreal Engine

slide-3
SLIDE 3

The appearance of a material is determined by the manner in which light is reflected from it, or transmitted through it.

slide-4
SLIDE 4

What is the most basic

material property?

slide-5
SLIDE 5

Colour: Spectral Reflectance Curves

[from scratchapixel.com]

slide-6
SLIDE 6

But not the only factor!

RenderMan PxrLM

slide-7
SLIDE 7

Let’s take a look at some

real world materials

slide-8
SLIDE 8

Hand with Reflecting Sphere (Self-Portrait)

M.C. Escher, 1935

slide-9
SLIDE 9

Ideal Specular Reflections

r = d − 2(d · ˆ n)ˆ n Trace another ray, as if you were looking from underneath.

slide-10
SLIDE 10

Real surfaces are not perfectly specular!

slide-11
SLIDE 11

Real surfaces are not perfectly specular!

slide-12
SLIDE 12

Mixed Specular Reflections

r = d − 2(d · ˆ n)ˆ n Add fraction of ray’s light with to surface material colour.

slide-13
SLIDE 13

But wait a minute…

What’s the difference? dielectric (non-conductor) metallic (conductor)

slide-14
SLIDE 14

Metallic Specular Reflections

r = d − 2(d · ˆ n)ˆ n Multiply reflected ray’s light with the surface material colour.

slide-15
SLIDE 15

A Glass Marble

What do we do with this material?

slide-16
SLIDE 16

Snell’s Law

  • Ratio of sines of angles is

equal to ratio of velocities:

sin θ sin φ = v vt = nt n

slide-17
SLIDE 17
slide-18
SLIDE 18

n Material 1.0001 air 1.333 water 1.47

  • live oil

1.52 crown glass 1.62 flint glass 2.15 cubic zirconia 2.42 diamond

Index of Refraction

  • f some common materials
slide-19
SLIDE 19

Ray Tracing Refraction

n sin θ = nt sin φ cos2 φ = 1 − n2(1 − cos2 θ) n2

t

t = n(d + ˆ n cos θ) nt − ˆ n cos φ

slide-20
SLIDE 20

A Diffuse Reflector

M.C. Escher, 1946

slide-21
SLIDE 21

Three Spheres II

M.C. Escher, 1946

slide-22
SLIDE 22

Properties of Diffuse Reflectors

slide-23
SLIDE 23
slide-24
SLIDE 24

Diffuse Reflection

  • Brightness dependent
  • nly on the direction of

incident light

  • View direction has no

effect on appearance

  • Lambert’s cosine law:

c ∝ ˆ n ·ˆ l c = crcl max(0, ˆ n ·ˆ l)

slide-25
SLIDE 25

Specular Highlights

A Heuristic Approximation

slide-26
SLIDE 26

Moonlight Reflection

What do you see in this picture?

slide-27
SLIDE 27

Plastic, Magnified

[image from gelsight.com]

slide-28
SLIDE 28

Microfacet Geometry Model

[images from Real-Time Rendering, A K Peters, 2008]

slide-29
SLIDE 29

Phong Lighting Model

r = −l + 2(l · ˆ n)ˆ n c = cl max(0, ˆ e · ˆ r)p

slide-30
SLIDE 30

Blinn-Phong Lighting Model

ˆ h = e + l ||e + l|| c = cl max(0, ˆ h · ˆ n)p

slide-31
SLIDE 31

The Phong Exponent

y = cosp θ

p = 1 p = 64

slide-32
SLIDE 32

Phong Highlights

slide-33
SLIDE 33

Summary: Types of Surface Reflectance

  • Ideal specular (mirror)
  • reflection law
  • Ideal diffuse (matte)
  • Lambert’s law
  • Specular (glossy)
  • directional diffuse
slide-34
SLIDE 34

What about

ambient light?

slide-35
SLIDE 35

Indirect Lighting

Material reflection works both ways!

slide-36
SLIDE 36

Global Illumination

direct indirect combined Global illumination is really hard and expensive to compute!

slide-37
SLIDE 37

Ambient Light

Approximated by a constant light source that represents the average indirect light energy in the scene.

c = crca

slide-38
SLIDE 38

Our final heuristic shading equation…

  • with ambient, diffuse, and specular terms:
  • cr is reflectance (diffuse) colour of material
  • cp is specular colour of material
  • p is Phong exponent, or shininess of material
  • cl is light source intensity (colour)
  • ca is ambient light intensity (colour)

c = cr ⇣ ca + cl max(0, ˆ n ·ˆ l) ⌘ + cl cp ⇣ ˆ h · ˆ n ⌘p

slide-39
SLIDE 39

Things to Remember

  • The appearance of a material is determined by the

manner in which light is reflected from it

  • The Phong lighting equation approximates material

colour, diffuse and specular reflection, and ambient light

  • Ideal specular reflection and refraction are relatively easy

to achieve with ray tracing