DOC PREVIEW
Berkeley COMPSCI 184 - Lecture Notes

This preview shows page 1-2-21-22 out of 22 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 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 22 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 22 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 22 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS-184: Computer GraphicsLecture #4: Shading Prof. James O’BrienUniversity of California, BerkeleyV2006-F-04-1.02TodayLocal Illumination & ShadingThe BRDFSimple diffuse and specular approximationsShading interpolation: flat, Gouraud, PhongSome miscellaneous tricks3Local ShadingLocal: consider in isolation 1 light1 surfaceThe viewerRecall: lighting is linear Almost always...3Local ShadingLocal: consider in isolation 1 light1 surfaceThe viewerRecall: lighting is linear Almost always...Counter example: photochromatic materials4Local ShadingExamples of non-local phenomenaShadowsReflectionsRefractionIndirect lighting5The BRDFρ(θV, θL)ρ(v, l, n)ρ ==The Bi-directional Reflectance Distribution FunctionGivenSurface materialIncoming light directionDirection of viewerOrientation of surfaceReturn: fraction of light that reaches the viewerWe’ll worry about physical units later...6The BRDFρ(v, l, n)ˆvˆlˆnSpatial variation capture by “the material”Frequency dependentTypically use separate RGB functionsDoes not work perfectlyBetter:ρ = ρ(θV, θL, λin, λout)7Obtaining BRDFsMeasure from real materialsImages from Marc Levoy8Obtaining BRDFsMeasure from real materialsComputer simulationSimple model + complex geometryDerive model by analysisMake something up9Beyond BRDFsThe BRDF model does not capture everythinge.g. Subsurface scattering (BSSRDF)Images from Jensen et. al, SIGGRAPH 200110Beyond BRDFsThe BRDF model does not capture everythinge.g. Inter-frequency interactionsρ = ρ(θV, θL, λin, λout)This version would work....11A Simple ModelApproximate BRDF as sum ofA diffuse componentA specular componentA “ambient” term+=+12Diffuse ComponentLambert’s LawIntensity of reflected light proportional to cosine of angle between surface and incoming light directionApplies to “diffuse,” “Lambertian,” or “matte” surfacesIndependent of viewing angleUse as a component of non-Lambertian surfaces13Diffuse ComponentkdI(ˆl ·ˆn)Comment about two-side lighting in text is wrong...max(kdI(ˆl ·ˆn), 0)14Diffuse ComponentPlot light leaving in a given direction:Plot light leaving from each point on surface14Diffuse ComponentPlot light leaving in a given direction:Plot light leaving from each point on surface14Diffuse ComponentPlot light leaving in a given direction:Plot light leaving from each point on surface15Specular ComponentSpecular component is a mirror-like reflectionPhong Illumination ModelA reasonable approximation for some surfacesFairly cheap to computeDepends on view direction16Specular ComponentksI(ˆr ·ˆv)pksI max(ˆr ·ˆv, 0)pLRVN17Specular ComponentComputing the reflected directionˆr = −ˆl + 2(ˆl ·ˆn)ˆnnlhωenlr-lθn cos θn cos θˆh =ˆl +ˆv||ˆl +ˆv||18Specular ComponentPlot light leaving in a given direction:Plot light leaving from each point on surface18Specular ComponentPlot light leaving in a given direction:Plot light leaving from each point on surface18Specular ComponentPlot light leaving in a given direction:Plot light leaving from each point on surface19Specular ComponentSpecular exponent sometimes called “roughness”n=1 n=2 n=4n=8n=256n=128n=64n=32n=1620Ambient TermReally, its a cheap hackAccounts for “ambient, omnidirectional light”Without it everything looks like it’s in space21Summing the PartsRecall that the are by wavelengthRGB in practiceSum over all lightsR = kaI + kdI max(ˆl ·ˆn, 0) + ksI max(ˆr ·ˆv, 0)pk?+=+22Anisotropy23Metal -vs- Plastic24Metal -vs- Plastic25Other Color Effects26Other 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 tempera-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 t wo 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 shift. However, the lackof a strong cool to warm hue shift and the lack of a luminance shiftmakes the shape information subtle. We speculate that the unnaturalcolors are also problematic.In order to automate this hue shift technique and to add some lu-minance variation to our use of tones, we can examine two extremepossibilities for color scale generation: blue to yellow tones andscaled object-color shades. Our final model is a linear combinationof these techniques. Blue and yellow tones are chosen to insure acool to warm color t r ansition regardless of the diffuse color of theobject.The blue-to-yellow tones range from a fully saturated blue:in RGB space to a fully saturated yel-low:. This produces a very sculptedbut unnatural image, and is independent of the object’s diffuse re-flectance. The extreme tone related to is a variation of dif-fuse shading whereis pure black and . Thiswould look


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?