Materials & Shading
CPSC 453 – Fall 2018 Sonny Chan
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
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
Colour: Spectral Reflectance Curves
[from scratchapixel.com]
But not the only factor!
RenderMan PxrLM
Let’s take a look at some
Hand with Reflecting Sphere (Self-Portrait)
M.C. Escher, 1935
Ideal Specular Reflections
r = d − 2(d · ˆ n)ˆ n Trace another ray, as if you were looking from underneath.
Real surfaces are not perfectly specular!
Real surfaces are not perfectly specular!
Mixed Specular Reflections
r = d − 2(d · ˆ n)ˆ n Add fraction of ray’s light with to surface material colour.
But wait a minute…
What’s the difference? dielectric (non-conductor) metallic (conductor)
Metallic Specular Reflections
r = d − 2(d · ˆ n)ˆ n Multiply reflected ray’s light with the surface material colour.
A Glass Marble
What do we do with this material?
Snell’s Law
equal to ratio of velocities:
sin θ sin φ = v vt = nt n
n Material 1.0001 air 1.333 water 1.47
1.52 crown glass 1.62 flint glass 2.15 cubic zirconia 2.42 diamond
Index of Refraction
Ray Tracing Refraction
n sin θ = nt sin φ cos2 φ = 1 − n2(1 − cos2 θ) n2
t
t = n(d + ˆ n cos θ) nt − ˆ n cos φ
A Diffuse Reflector
M.C. Escher, 1946
Three Spheres II
M.C. Escher, 1946
Properties of Diffuse Reflectors
Diffuse Reflection
incident light
effect on appearance
c ∝ ˆ n ·ˆ l c = crcl max(0, ˆ n ·ˆ l)
Specular Highlights
A Heuristic Approximation
Moonlight Reflection
What do you see in this picture?
Plastic, Magnified
[image from gelsight.com]
Microfacet Geometry Model
[images from Real-Time Rendering, A K Peters, 2008]
Phong Lighting Model
r = −l + 2(l · ˆ n)ˆ n c = cl max(0, ˆ e · ˆ r)p
Blinn-Phong Lighting Model
ˆ h = e + l ||e + l|| c = cl max(0, ˆ h · ˆ n)p
The Phong Exponent
y = cosp θ
p = 1 p = 64
Phong Highlights
Summary: Types of Surface Reflectance
What about
Indirect Lighting
Material reflection works both ways!
Global Illumination
direct indirect combined Global illumination is really hard and expensive to compute!
Ambient Light
Approximated by a constant light source that represents the average indirect light energy in the scene.
c = crca
Our final heuristic shading equation…
c = cr ⇣ ca + cl max(0, ˆ n ·ˆ l) ⌘ + cl cp ⇣ ˆ h · ˆ n ⌘p
Things to Remember
manner in which light is reflected from it
colour, diffuse and specular reflection, and ambient light
to achieve with ray tracing