Lec 10
Lec 10
/ Light / Textures
Thanks to Srinivas Narasimhan, Langer-‐‑Zucker, Henrik Wann Jensen, Ravi Ramamoorthi,
Hanrahan, Preetham
Real-‐‑world objects – Phong Illumination Model is not adequate
BRDF: Bidirectional Reflectance Distribution Function
source
z
incident
direction
viewing
direction
θ
(θi , φi ) (θr ,φr )
normal
y
φ
surface
element
x
Lsurface (θ r , φr )
f (θ i , φi ; θ r , φr )
BRDF :
=
E surface (θ i , φi )
Important Properties of BRDFs
source
z
incident
direction
viewing
direction
θ
(θi , φi ) (θr ,φr )
normal
y
φ
surface
x
element
f (θi , φi ; θ r , φr ) = f (θ r , φr ; θi , φi )
Diffuse Reflection and Lambertian BRDF
Rendered Sphere with Lambertian BRDF
v r
• All incident light energy reflected in a SINGLE direction. (only when = )
Specular
Reflec,ons
in
Nature
• Many glossy surfaces show broader highlights in addition to mirror reflection.
• Surfaces are not perfectly smooth – they show micro-‐‑surface geometry (roughness).
Blurred Highlights and Surface Roughness
Roughness
Phong Examples
h9p://www.graphics.cornell.edu/~westin/misc/fresnel.html
Reflections on water surfaces -‐‑ Glieering
Split off-‐‑specular Reflections in Woven Surfaces
Why does the Full Moon have a flat appearance?
Lambertian model
Valid for only SMOOTH MATTE surfaces.
Bad for ROUGH MATTE surfaces.
Modeling
Rough
Surfaces
-‐
Microfacets
•Distribu,on on the slopes of the V-‐grove faces are modeled.
0º/45º
45º/45º
Diffuse Measurement
Specular Measurement
Gloss Measurements
• Example: “contrast gloss” is essentially ratio of specular to diffuse
• “Haze” and “distinctness of image” are measurements of width of
specular peak
Gonioreflectometers
• hep://www.disneyanimation.com/technology/
brdf.html
Real objects have texture!
Every triangle can be supplied with texture
coordinates, which are interpolated over the
triangle during rasterization
Uses for Texture Mapping
Use texture to affect a variety of parameters
• surface color - radiance of each point on surface (Catmull 1974)
• surface reflectance - reflectance coefficients kd, ks, or nshiny
• normal vector - bump mapping (Blinn 1978)
• geometry - displacement mapping
• transparency - transparency mapping (clouds) (Gardener 1985)
• light source radiance - environment mapping (Blinn 1978)
Radiance vs. Reflectance Mapping
+ =
Sphere w/ Uniform Diffuse coefficient Radiance Map Sphere w/ Radiance Map
+ =
Sphere w/ Uniform Diffuse coefficient Reflectance (kd) Map Sphere w/ Reflectance Map
Texture specifies diffuse color (kd coefficients) for each point on surface
- three coefficients, one each for R, G, and B radiance channels
•
Bump Mapping
Basic texture mapping paints on to a smooth surface
• How do you make a surface look rough?
– Option 1: model the surface with many small polygons
– Option 2: perturb the normal vectors before the shading
calculation
+ =
Sphere w/Diffuse Texture Map
Bump Map
Sphere w/Diffuse Texture + Bump Map
Bump Mapping
• We can perturb the normal vector without having to
make any actual change to the shape.
• This illusion can be seen through—how?
Original model (5M) Simplified (500) Simple model with bump map
Bump Mapping
Greg Turk
Another Bump Mapping Example
+ =
Bump Map
Cube is a natural
intermediate object
for a room
eye
Environment Mapping: Cube Maps
Basics of Texture Mapping in OpenGL
Glubyte my_texels[512][512][3];
Gluint texID;
glGenTextures(1, &texID);
glBindTexture(GL_TEXTURE_2D, texID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0,
GL_RGB,GL_UNSIGNED_BYTE, my_texels);
/* level, components, w, h, border, format, type, tarray */
• www.uvmapper.com
Data Driven Approaches
• Made popular by Efros and Leung, 1999
hep://graphics.cs.cmu.edu/people/efros/research/EfrosLeung.html
Procedural Methods
Reaction-Diffusion
Greg Turk, Siggraph ‘91
Solid Textures
• Have a 3-D array of texture values (e.g., a
block of marble)
Sketch a picture of what you think the BRDF might look like for
a single incoming light direction and a particular surface. Please
assume an incoming light direction 45 degrees from the surface
normal. Assume a surface with both diffuse color and
highlights, e.g. a green pepper. Write notes to explain your
sketch.
Are there types of materials for which a constant is acceptable as
a BRDF? What would such a surface look like?
Practice Problems
Describe an experiment to measure the BRDF that you sketched
for the problem on the previous slide.
What data structure would you use to store such a BRDF?
Are there types of materials for which a one-‐‑dimensional
function is acceptable as a BRDF? a two-‐‑dimensional function?
a three-‐‑dimensional function? When do you need all four
parameters to represent the BRDF adequately? When might you
need five dimensions instead of four?
Practice Problems