DOC PREVIEW
Berkeley COMPSCI 184 - Lecture Notes

This preview shows page 1-2-24-25 out of 25 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 25 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 25 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 25 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 25 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 25 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS-184: Computer GraphicsLecture #3: Shading Prof. James O’BrienUniversity of California, BerkeleyV2011-F-03-1.02Announcements•Assignment 1: due Friday, Sept 2•Assignment 2: due Tuesday, Sept 6•Assignment 3: due Monday, Sept 19Wednesday, August 31, 113Today•Local Illumination & Shading•The BRDF•Simple diffuse and specular approximations•Shading interpolation: flat, Gouraud, Phong•Some miscellaneous tricks4Local Shading•Local: consider in isolation •1 light•1 surface•The viewer•Recall: lighting is linear •Almost always...Wednesday, August 31, 114Local Shading•Local: consider in isolation •1 light•1 surface•The viewer•Recall: lighting is linear •Almost always...Counter example: photochromatic materials5Local Shading•Examples of non-local phenomena•Shadows•Reflections•Refraction•Indirect lightingWednesday, August 31, 116The BRDFρ(θV, θL)ρ(v, l, n)ρ ==•The Bi-directional Reflectance Distribution Function•Given•Surface material•Incoming light direction•Direction of viewer•Orientation of surface•Return: •fraction of light that reaches the viewer•We’ll worry about physical units later...7The BRDFρ(v, l, n)ˆvˆlˆn•Spatial variation capture by “the material”•Frequency dependent•Typically use separate RGB functions•Does not work perfectly•Better:ρ = ρ(θV, θL, λin, λout)Wednesday, August 31, 118Obtaining BRDFs•Measure from real materialsImages from Marc Levoy9Obtaining BRDFs•Measure from real materials•Computer simulation•Simple model + complex geometry•Derive model by analysis•Make something upWednesday, August 31, 1110Beyond BRDFs•The BRDF model does not capture everything•e.g. Subsurface scattering (BSSRDF)Images from Jensen et. al, SIGGRAPH 200111Beyond BRDFs•The BRDF model does not capture everything•e.g. Inter-frequency interactionsρ = ρ(θV, θL, λin, λout)This version would work....Wednesday, August 31, 1112A Simple Model•Approximate BRDF as sum of•A diffuse component•A specular component•A “ambient” term+=+13Diffuse Component•Lambert’s Law•Intensity of reflected light proportional to cosine of angle between surface and incoming light direction•Applies to “diffuse,” “Lambertian,” or “matte” surfaces•Independent of viewing angle•Use as a component of non-Lambertian surfacesWednesday, August 31, 1114Diffuse ComponentkdI(ˆl ·ˆn)Comment about two-side lighting in text is wrong...max(kdI(ˆl ·ˆn), 0)15Diffuse Component•Plot light leaving in a given direction:•Plot light leaving from each point on surfaceWednesday, August 31, 1115Diffuse Component•Plot light leaving in a given direction:•Plot light leaving from each point on surface15Diffuse Component•Plot light leaving in a given direction:•Plot light leaving from each point on surfaceWednesday, August 31, 1116Specular Component•Specular component is a mirror-like reflection•Phong Illumination Model•A reasonable approximation for some surfaces•Fairly cheap to compute•Depends on view direction17Specular ComponentksI(ˆr ·ˆv)pksI max(ˆr ·ˆv, 0)pLRVNWednesday, August 31, 1118Specular Component•Computing the reflected directionˆr = ˆl + 2(ˆl ·ˆn)ˆnnlr-lθn cos θn cos θ19Specular Component•“Half-angle” approximation for specularnlhωeˆh =ˆl +ˆv||ˆl +ˆv||*Don’t use half-angle approximation in your assignment!ksI(ˆh ·ˆn)pdifferent specular termWednesday, August 31, 1120Specular Component•Plot light leaving in a given direction:•Plot light leaving from each point on surface20Specular Component•Plot light leaving in a given direction:•Plot light leaving from each point on surfaceWednesday, August 31, 1120Specular Component•Plot light leaving in a given direction:•Plot light leaving from each point on surface21Specular Component•Specular exponent sometimes called “roughness”n=1 n=2 n=4n=8n=256n=128n=64n=32n=16Wednesday, August 31, 1122Ambient Term•Really, its a cheap hack•Accounts for “ambient, omnidirectional light”•Without it everything looks like it’s in space23Summing the Parts•Recall that the are by wavelength•RGB in practice•Sum over all lightsR = kaI + kdI max(ˆl ·ˆn, 0)+ksI max(ˆr ·ˆv, 0)pk?+=+Wednesday, August 31, 1124Anisotropy25Metal -vs- PlasticWednesday, August 31, 1126Metal -vs- Plastic27Other Color EffectsWednesday, August 31, 1128Other Color EffectsImages from Gooch et. al, 1998+=pure blue to yellowpure black to object colordarkenselectfinal toneFigure 2: How the tone is created for a pure red object by summinga blue-to-yellow and a dark-red-to-red tone.created by adding grey to a certain color they are called tones [2].Such tones vary in hue but do not typically vary much in luminance.When the complement of a color is used to create a color scale, theyare also called tones. Tones are considered a crucial concept to il-lustrators, and are especially useful when the illustrator is restrictedto a small luminance range [12]. Another quality of color used byartists is the temperature of the color. The temperature of a coloris defined as being warm (red, orange, and yellow), cool (blue, vi-olet, and green), or temperate (red-violets and yellow-greens). Thedepth cue comes from the perception that cool colors recede whilewarm colors advance. In addition, object colors change t empera-ture in sunlit scenes because cool skylight and warm sunlight varyin relative contribution across the surface, so there may be ecolog-ical reasons to expect humans to be sensitive to color temperaturevariation. Not only is the temperature of a hue dependent uponthe hue itself, but this advancing and receding relationship is ef-fected by proximity [4]. We will use these techniques and theirpsychophysical relationship as the basis for our model.We can generalize the classic computer graphics shading modelto experiment with tones by using the cosine term () of Equa-tion 1 to blend between two RGB colors,and :(2)Note that the quantityvaries over the interval . To ensurethe image shows this full variation, the light vectorshould be per-pendicular to the gaze direction. Because the human vision systemassumes illumination comes from above [9], we chose to positionthe light up and to the right and to keep this position constant.An image that uses a color scale with little luminance variationis shown in Figure 6. This image shows that a sense of depth can becommunicated at least partially by a hue


View Full Document

Berkeley COMPSCI 184 - Lecture Notes

Documents in this Course
Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?