Agenda • Quiz #1 Week 3 • Critique & review of Project1 Amy Gooch • Lecture on Shading & Texturing CS395: Intro to Animation • Looking forward to next assignment – Bring to class material samples (images or objects) Quiz #1 Critique and Review of Project 1 1
Project 2 Project 2 Group Assignments Group1 Che Yusoff, Asrif Johnson, Rejaie Schatz, Matthew Group2 Chin, Ying (YZ) Krueger, DeBorah Meor Hamzah, Nurul Group3 Ku Abdul Rahman, Nizar Miller, Josh Pylypczak, Jaroslav Group4 Md Ishak, Nizam Nesbitt, Kiel Teng, Xian Yi Group5 Edwards, Tennile Simpson, Alan Shading Lambert’s law Light a point in any direction varies as the cosine of the angle between a vector from the point to the light source and the normal vector of the surface at the point n L θ 2
Warnock (Flat) Shading Gouraud Shading • Compute • Flat shading shading at • Decrease intensity each vertex with distance from • Interpolate light and object shading • Highlights Problem with Gouraud Shading Phong Shading • Highlights across polygons Phong Shading Diffuse Shading I diffuse = k d I light cos θ n L eye θ 3
Specular Shading Phong Shading Add specular by looking at lights reflection, r I total = k a I ambient + Σ I i ( k d (N . L) + k s (V . R) n shiney ) Shiny surfaces, such as a i = 1 mirror n n L L r r θ θ e θ θ e σ σ Review: Surface Properties Review: Surface Properties Phong Shading Perfectly Specular Perfectly Specular: : Incident Incident Surface Surface “Mirror “ Mirror” ” Light Light Normal Normal Ray Ray “infinite gloss infinite gloss” ” “ Reflected Reflected Light Light θ θ n Phong Phong L r Specular Specular Model: Model: θ θ e σ cos ∞ ( L R cos ( θ ) L R θ ) Andrew Andrew Glassner Glassner et al.. SIGGRAPH`94 Course 18: et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics Fundamentals and Overview of Computer Graphics” Review: Surface Properties Surface Properties Review: Surface Properties Surface Properties Review: Review: Slightly scattered Specular Slightly scattered Specular: : More Scattered Specular More Scattered Specular: : Incident Incident Incident Incident Surface Surface Surface Surface “high gloss “ high gloss” ” “medium gloss “ medium gloss” ” Light Light Light Light Normal Normal Normal Normal Reflected Reflected Ray Ray Ray Ray Light Light Phong Phong Phong Phong Specular Specular Specular Specular Model: Model: Model: Model: L R cos 15 15 ( L R cos 5 ( L R cos ( θ θ ) ) L R cos ( θ θ ) ) Andrew Andrew Glassner Glassner et al.. SIGGRAPH`94 Course 18: et al.. SIGGRAPH`94 Course 18: Andrew Glassner Andrew Glassner et al.. SIGGRAPH`94 Course 18: et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics Fundamentals and Overview of Computer Graphics” “Fundamentals and Overview of Computer Graphics Fundamentals and Overview of Computer Graphics” 4
Review: Surface Properties Review: Surface Properties Review: Surface Properties Review: Surface Properties Perfectly Diffuse Perfectly Diffuse Most Materials: Most Materials: Incident Incident Incident Incident Surface Surface Surface Surface “flat flat” ”, , “ “chalky chalky” ”, ,… … Combination of “ Combination of Light Light Light Light Normal Normal Normal Normal Ray Ray Ray Ray Diffuse and Specular Diffuse and Specular Andrew Andrew Glassner Glassner et al.. SIGGRAPH`94 Course 18: et al.. SIGGRAPH`94 Course 18: Andrew Andrew Glassner Glassner et al.. SIGGRAPH`94 Course 18: et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics Fundamentals and Overview of Computer Graphics” “Fundamentals and Overview of Computer Graphics Fundamentals and Overview of Computer Graphics” Rendering Realism OpenGL Lighting Equation vertex color = emission material + ambient light model * ambient_ material + Σ i=0 (1/(k c + k i *d + k q d 2 ) * (spotlight effect) i * n-1 [ ambient light *ambient material + (max { L · n , 0} ) * diffuse light * diffuse material + (max { s · n , 0} )shininess * specular light * specular material ] i Cornel Measurement Lab Rendering Realism Is this real? Synthetic Real Shirley, et. al., cornell m fajaro, usc 5
Rendering Realism Terrain Modeling: Snow and Trees Added Morning Evening s premoze, et.al., utah a preetham, et. al., Humans Artistic Shading Final Fantasy (Sony) Jensen et al. Is Photorealism Everything? Is Photorealism Everything? 6
Enough Information…? Just a bit more… Diffuse shaded model Or did we mean this…? I = c r ( c a + c l max(0, L . n)) with c r =c l =1 and c a = 0. Just Highlights and Edge Lines Hand-tuned Phong shading 7
Shading used by Artists Complementary Shading Final Image From Jose Parramon, 1993 From Jose Parramon, 1993 From “The Book of Color” by Jose Parramon, 1993 Tints, Tones, and Shades Creating Tones White tint tint Green to Gray (tone) Hue tone tone Gray shade From From Birren Birren (1976) (1976) Black Model Shaded using Tones Using Color Temperature Warm to Cool Hue Shift 8
Constant Luminance Tone Rendering Creating Undertones Warm to Cool Hue Shift Green with Warm to Cool Hue Shift Model tone shaded with Combining Tones with Undertones cool to warm undertones Green with Tone and Undertone Model shaded with tones and undertones 9
Phong Shaded Spheres Phong Shading Formula Spheres with New Shading c = c r (c a + c l max(0, L . n ) ) + c l c p cos ( h . n ) n New Shading New Shading Formula I = k w c warm + (1 - k w ) c cool where k w = (1 + (L . n) )*.5) 10
OpenGL Approximation OpenGL Approximation Without Highlights Without Highlights With highlights Light RGB Intensities L 1 = (0.5, 0.5, 0.0) L 2 = (-0.5, -0.5, 0) Warm to Cool Shading Toon Shading New Shading New Shading Phong Shaded Without Edge Lines With Edge Lines Intel: http://www.intel.com/labs/media/3dsoftware/nonphoto.htm Toon Shading Toon Shading Nvidia: developer.nvidia.com/object/Toon_Shading.html Blender: w3imagis.imag.fr/Membres/Jean-Dominique.Gascuel/DEAIVR/ Cours2002/17%20janvier/Blender-tutorial80.pdf 11
Non-Photorealistic Rendering NonPhotorealistic Rendering b gooch, et.al., utah Surface mapping • Texture mapping • Bump Mapping • Displacement mapping – Actually moving geometry – ie Create screw from cylinder, Terrain, etc Controlling Filtering Controlling Filtering What does a pixel see? From Tomas Akenine-Moller 12
Repeat, Mirror, Clamp, Border Mipmapping • Image pyramid • Half height and width • Compute d – Gives 2 images • Bilinear Interpolate in each image From Tomas Akenine-Moller From Tomas Akenine-Moller MipMapping Memory Environment Mapping Requirements • Assume environment infinitely far away • Sphere mapping • Cube mapping (now norm) – No singularities – Much less distortion – Better result – Not dependent on view position Cube Mapping Bump Mapping • Simple math: = + – Compute reflection vector r – Largest abs-value of component determines Geometry Bump map Bump mapped which cube face geometry • Example: r = (5, -1, 2) give POS_X face • Divide r by 5 gives (u,v) =-1/5, 2/5) – Hardware often does all the work 13
Bump Mapping Example Bump Mapping Example 14
Recommend
More recommend