Shading - PowerPoint PPT Presentation

1 / 74
About This Presentation
Title:

Shading

Description:

Shading – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 75
Provided by: FredoD5
Category:
Tags: shading | udal

less

Transcript and Presenter's Notes

Title: Shading


1
Shading Material Appearance
Lots of slides from Addy Ngan
2
Discussion about mass-spring
  • Possible topics
  • Implementation is hard
  • Stability
  • Damping
  • Euler vs. Runge Kutta
  • Constant tuning
  • Difficulty of assignments

3
Assignment 4 Ray casting
  • Lots of code design, more than for assignment 3
  • We give you
  • Image class
  • VL
  • parser
  • Ray, Hit classes
  • You have to design code
  • Object3D, Sphere, plane, triangle
  • Group, transform
  • Material, diffuse shading
  • Camera, orthographic, perspective
  • different visualization (color, normal, t)
  • Will be used in assignment 5 ray tracing
  • Used to be two one-week assignment
  • Prove that you can manage your time!

4
Material appearance
  • Input for realistic rendering
  • Geometry, Lighting and Materials
  • Materials appearance
  • Color
  • Texture
  • Intensity and shape of highlights
  • Glossiness

Slide Addy Ngan
5
BRDF
  • Bidirectional Reflectance Distribution Function
  • Ratio of light coming from one directionthat
    gets reflected in another direction
  • Focuses on angular aspects, not spatial variation
    of the material
  • How many dimensions?

Incoming direction
Outgoing direction
6
BRDF
  • Bidirectional Reflectance Distribution Function
  • 4D
  • 2 angles for each direction
  • R(?i ,?i ?o, ?o)

7
Slice at constant incidence
  • 2D spherical function

highlight
incoming
incoming
Example Plot of PVC BRDF at 55 incidence
8
Laser demo
9
Unit issues - radiometry
  • We will not be too formal in this lecture
  • Typical issues
  • Directional quantities vs. integrated over all
    directions
  • Differential terms per solid angle, per area,
    per time
  • Power, intensity, flux

10
Light sources
  • Today, we only consider point light sources
  • For multiple light sources, use linearity
  • We can add the solutions for two light sources
  • I(ab)I(a)I(b)
  • We simply multiply the solution when we scale the
    light intensity
  • I(s a) s I(a)

a
b
11
Light intensity
  • 1/r2 falloff
  • Why?
  • Same power in all concentric circles
  • but in graphics we often cheat with or ignore
    this term.
  • In particular, 1/(arb) is popular

12
Incoming radiance
  • The amount of light received by a surface depends
    on incoming angle
  • Bigger at normal incidence
  • Similar to Winter/Summer difference
  • By how much?
  • Cos ? law
  • Dot product with normal
  • This term is sometimes included in the BRDF,
    sometimes not

n
?
13
Questions?
14
Ideal Diffuse Reflectance
  • Assume surface reflects equally in all
    directions.
  • An ideal diffuse surface is, at the microscopic
    level, a very rough surface.
  • Example chalk, clay, some paints

15
Ideal Diffuse Reflectance
  • Ideal diffuse reflectors reflect light according
    to Lambert's cosine law.

16
Ideal Diffuse Reflectance recap
  • Single Point Light Source
  • kd diffuse coefficient.
  • n Surface normal.
  • l Light direction.
  • Li Light intensity
  • r Distance to source

n
?
r
l
17
Ideal Diffuse Reflectance More Details
  • If n and l are facing away from each other, n l
    becomes negative.
  • Using max( (n l),0 ) makes sure that the result
    is zero.
  • From now on, we mean max() when we write .
  • Do not forget to normalize your vectors for the
    dot product!

18
Questions?
19
Ideal Specular Reflectance
  • Reflection is only at mirror angle.
  • View dependent
  • Microscopic surface elements are usually oriented
    in the same direction as the surface itself.
  • Examples mirrors, highly polished metals.

n
?
?
l
r
20
Non-ideal Reflectors
  • Real materials tend to deviate significantly from
    ideal mirror reflectors.
  • Highlight is blurry
  • They are not ideal diffuse surfaces either

21
Non-ideal Reflectors
  • Simple Empirical Model
  • We expect most of the reflected light to travel
    in the direction of the ideal ray.
  • However, because of microscopic surface
    variations we might expect some of the light to
    be reflected just slightly offset from the ideal
    reflected ray.
  • As we move farther and farther, in the angular
    sense, from the reflected ray we expect to see
    less light reflected.

22
The Phong Model
  • How much light is reflected?
  • Depends on the angle between the ideal reflection
    direction and the viewer direction ?.

n
r
?
?
l
Camera
?
v
23
The Phong Model
  • Parameters
  • ks specular reflection coefficient
  • q specular reflection exponent

n
r
?
?
l
Camera
?
v
24
The Phong Model
  • Effect of the q coefficient

25
Phong Examples
  • The following spheres illustrate specular
    reflections as the direction of the light source
    and the coefficient of shininess is varied.

Phong
26
How to get the mirror direction?
n
r
?
?
l
r
27
The Phong Model
  • Sum of three components
  • diffuse reflection
  • specular reflection
  • ambient.

28
Ambient Illumination
  • Represents the reflection of all indirect
    illumination.
  • This is a total hack!
  • Avoids the complexity of global illumination.

29
Putting it all together
  • Phong Illumination Model

30
Questions?
31
Adding color
  • Diffuse coefficients
  • kd-red, kd-green, kd-blue
  • Specular coefficients
  • ks-red, ks-green, ks-blue
  • Specular exponent
  • q

32
Fresnel Reflection
  • Increasing specularity near grazing angles.

Source Lafortune et al. 97
33
Questions?
34
Material appearance techniques
  • BRDF models specular lobe
  • Intuition
  • maximum when view aligned with the reflected
    light
  • Reflection-vector lobe
  • (V R)n
  • e.g. Phong 75, Lafortune 97
  • Half-vector lobe
  • (H N)n
  • e.g. Ward 92, Cook-Torrance 81

35
Blinn-Torrance Variation of Phong
  • Uses the halfway vector h between l and v.

n
h
?
l
Camera
v
36
Lobe Comparison
  • Half vector lobe
  • Gradually narrower when approaching grazing
  • Mirror lobe
  • Always circular

Half vector lobe
Mirror lobe
37
Half vector lobe
  • Consistent with what we observe in the dataset.
  • More details in our paper

Example Plot of PVC BRDF at 55 incidence
38
Questions?
39
Microfacet Theory
  • Example
  • Water surface as a microfacet distribution
  • Bright pixels
  • Microfacets aligned with the vector between sun
    and eye
  • But not the ones in shadow
  • And not the ones that are occluded

40
Microfacet Theory
  • Model surface by tiny mirrors Torrance Sparrow
    1967

41
Microfacet Theory
  • Value of BRDF at (L,V) is a product of
  • number of mirrors oriented halfway between L and
    V

42
Microfacet Theory
  • Value of BRDF at (L,V) is a product of
  • number of mirrors oriented halfway between L and
    V

43
Microfacet Theory
  • Value of BRDF at (L,V) is a product of
  • number of mirrors oriented halfway between L and
    V

44
Microfacet Theory
  • Value of BRDF at (L,V) is a product of
  • number of mirrors oriented halfway between L and
    V
  • ratio of the un(shadowed/masked) mirrors

45
Microfacet Theory
  • Value of BRDF at (L,V) is a product of
  • number of mirrors oriented halfway between L and
    V
  • ratio of the un(shadowed/masked) mirrors
  • Fresnel coefficient

46
Microfacet Theory-based Models
  • Develop BRDF models by imposing simplifications
    Torrance-Sparrow 67, Blinn 77, Cook-Torrance
    81
  • Microfacet normal distribution p(H)
  • Gaussian-like

spherical plot of a Gaussian-like p(H)
47
Microfacet Theory-based Models
  • Develop BRDF models by imposing simplifications
    Torrance-Sparrow 67, Blinn 77, Cook-Torrance
    81
  • Microfacet normal distribution p(H)
  • Gaussian-like
  • Shadowing/Masking
  • Assume V-cavities
  • Independent of p(H)

spherical plot of a Gaussian-like p(H)
48
Dark blue paint
Acquired data
Lighting
Material Dark blue paint
49
Dark blue paint
Acquired data
Blinn-Phong
Material Dark blue paint
50
Dark blue paint
Acquired data
Cook-Torrance
Material Dark blue paint
51
Questions?
52
Observations
  • Some materials impossible to represent with a
    single lobe

Acquired data
Cook-Torrance
Material Red Christmas Ball
53
Adding a second lobe
  • Some materials impossible to represent with a
    single lobe

Acquired data
Cook-Torrance 2 lobes
Material Red Christmas Ball
54
Questions?
55
Anisotropic BRDFs
  • Surfaces with strongly oriented microgeometry
    elements
  • Examples
  • brushed metals,
  • hair, fur, cloth, velvet

Source Westin et.al 92
56
Anisotropic measurement
  • Extension to Marschner 00, Matusik 03
  • Cut multiple strips from material sample at
    different orientations

Cutting material strips at different orientations
57
Anisotropic Materials
Brushed Aluminum
Yellow Satin
Purple Satin
Red Velvet
58
Purple Satin
  • Split specular reflection
  • Impossible to model with Gaussian-like
    distribution

spherical plot of a Gaussian-like p(H)
Measured data
59
Purple Satin
  • Split specular reflection
  • Our estimated distribution shows two main peaks

spherical plot of the estimated p(H)
Measured data
60
Purple Satin
  • Split specular reflection
  • Possible explanation from the microgeometry

spherical plot of the estimated p(H)
Macro photograph cone pairs overlay
61
Questions
62
Spatially-varying materials
  • Bidirectional Texture Function (BTF)
  • 6D (2D for space, 2D for incoming light, 2D view)

Texture mapped
BTF
Sattler 03
Sattler 03
63
BTFs
  • BTF acquired by Addy Ngan

64
Questions?
  • Image Addy Ngan

65
Questions?
66
Shaders (Material class)
  • Functions executed when light interacts with a
    surface
  • Constructor
  • set shader parameters
  • Inputs
  • Incident radiance
  • Incident reflected light directions
  • surface tangent (anisotropic shaders only)
  • Output
  • Reflected radiance

67
Shader
  • Initially for production (slow) rendering
  • Renderman in particular
  • Now used for real-time (Games)
  • Evaluated by graphics hardware

68
Questions?
69
Procedural Textures
  • f (x,y,z) ? color

Image by Turner Whitted
70
Procedural Textures
  • Advantages
  • easy to implement in ray tracer
  • more compact than texture maps (especially for
    solid textures)
  • infinite resolution
  • Disadvantages
  • non-intuitive
  • difficult to match existing texture

71
Questions?
Justin Legakis
Ken Perlin
Justin Legakis
72
(No Transcript)
73
BRDFs in the movie industry
  • http//www.virtualcinematography.org/publications/
    acrobat/BRDF-s2003.pdf
  • For the Matrix movies
  • Clothes of the agent Smith are CG, with measured
    BRDF

74
How do we obtain BRDFs?
  • Gonioreflectometer
  • 4 degrees of freedom

Source Greg Ward
75
BRDFs in the movie industry
  • http//www.virtualcinematography.org/publications/
    acrobat/BRDF-s2003.pdf
  • For the Matrix movies

gonioreflectometer
Measured BRDF
Measured BRDF
Test rendering
76
Photo
CG
Photo
CG
77
Questions?
Write a Comment
User Comments (0)
About PowerShow.com