Shading Adding Color 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 q Warnock (Flat) Shading • Flat shading • Decrease intensity with distance from light and object • Highlights Gouraud Shading • Compute shading at each vertex • Interpolate shading Problem with Gouraud Shading • Highlights across polygons Phong Shading Phong Shading Diffuse Shading Idiffuse = kd Ilight cos q n L q eye Specular Shading Add specular by looking at reflection, r Shiny surfaces, such as a mirror n L q q s r e Phong Shading lights Itotal = ka Iambient + Si = 1 I (k (N . L) + k (V . R)n ) n L q q s i r e d s shiney Phong Shading n L q q s r e Review: Surface Properties Perfectly Specular: “Mirror” “infinite gloss” Surface Normal Reflected Light q Phong Specular Model: L R cos (q) Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Incident Light Ray Review: Surface Properties Slightly scattered Specular: “high gloss” Reflected Light Surface Normal Phong Specular Model: 15 L R cos (q) Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Incident Light Ray Review: Surface Properties More Scattered Specular: “medium gloss” Surface Normal Phong Specular Model: 5 L R cos (q) Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Incident Light Ray Review: Surface Properties Perfectly Diffuse “flat”, “chalky”,… Surface Normal Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Incident Light Ray Review: Surface Properties Most Materials: Combination of Diffuse and Specular Surface Normal Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Incident Light Ray Rendering Realism Cornel Measurement Lab Rendering Realism Real Synthetic Shirley, et. al., cornell Is this real? m fajaro, usc Terrain Modeling: Snow and Trees Added s premoze, et.al., utah Rendering Realism Morning Evening a preetham, e Humans Final Fantasy (Sony) Jensen et al. Artistic Shading Is Photorealism Everything? Is Photorealism Everything? Enough Information…? Just a bit more… Or did we mean this…? Diffuse shaded model I = cr(ca + cl max(0, L.n)) with cr=cl=1 and ca = 0. Just Highlights and Edge Lines Hand-tuned Phong shading From Jose Parramon, 1993 Shading used by Artists Complementary Shading Final Image From “The Book of Color” by Jose Parramon, 1993 Tints, Tones, and Shades White tint Hue tone Gray shade From Birren (1976) Black Creating Tones Green to Gray (tone) Model Shaded using Tones Using Color Temperature Warm to Cool Hue Shift Constant Luminance Tone Rendering Creating Undertones Warm to Cool Hue Shift Green with Warm to Cool Hue Shift Model tone shaded with cool to warm undertones Combining Tones with Undertones Green with Tone and Undertone Model shaded with tones and undertones Phong Shaded Spheres Spheres with New Shading New Shading Warm to Cool Shading Phong Shaded New Shading Without Edge Lines New Shading With Edge Lines Toon Shading Intel: http://www.intel.com/labs/media/3dsoftware/nonphoto.htm Toon Shading Nvidia: developer.nvidia.com/object/Toon_Shading.html Toon Shading Blender: w3imagis.imag.fr/Membres/Jean-Dominique.Gascuel/DEAIVR/ Cours2002/17%20janvier/Blender-tutorial80.pdf Non-Photorealistic Rendering b gooch, et.al., utah NonPhotorealistic Rendering Shading in Maya Hypershade • Shading models = Materials Material Types • Lambert – Flat, matte, diffuse, rough surface – Reflection greatest where surface orientation is coincident with light direction Material Types Material Types • Phong – Shiny, glossy, smooth surface – Lambert + highlight Material Types • PhongE – Similar to Phong, but with softer highlight – Renders slightly faster than Phong Material Types • Blin – Simulating metallic surfaces – More control over highlight Material Types • Anisotropic – Simulates small, invisible grooves Material Attributes • Color Material Attributes • Transparency Material Attributes • Ambient color – adds color to all parts of the object Add deep purple Material Attribute • Incadenscence – Simulate light being reflect from object itself • Does not actually affect other objects Adding slight dark green incandescence: Material Attribute • Translucence – Light pass thru opaque material 0.0 0.6 Ray Tracing • http://www.cs.berkeley.edu/~efros/java/tracer/tracer.ht ml • http://www.siggraph.org/education/materials/HyperGr aph/raytrace/rt_java/raytrace.html Shadows • Shadows are created with…. 1) Shadow casting light(s) – Depth Map Shadows or Ray Trace Shadows on/off (attribute) 2) Surface(s) that cast shadows – Render Stats attribute -> Casts Shadows (checked/unchecked) 3) Surface(s) that receive shadows – Render Stats attribute -> Receive Shadows (checked/unchecked) Shadow Properties • Color • Softness: Gradiation/blurring of shadow edges • Graininess: smoothness of shadow edge Depth Map shadows • Per light, shadows section, attribute editor > Use Depth Map Depth map Properties: Graininess • Shadows attribute > Dmap resolution (on light) • Higher resolution increases rendering time • Dmap resolution 256 512 Depth map properties: Softness • Shadows attribute – Dmap Filter Size (on light) • Tip: drop Dmap resolution size, increase filter size • Higher filter size increases rendering time • Dmap res = 128, filter size = 3, 5, 7 Trouble Shooting Dmap • http://woodall.ncsa.uiuc.edu/dbock/Class/cs c187/Lecture/LightingAndShadows.html Ray-traced shadows • Per light, shadows section, attribute editor – Use Ray Trace Shadows • Window->Render Globals, Raytracing quality, turn on raytracing Ray-traced shadow properties • Softness/Graininess – smoothness of shadow edges • Shadows attribute – Light radius (point, spot) or light angle (directional) • Shadows attribute – Shadow Rays (on light) • Tip – time consuming for soft edges w/ ray-tracing • Light radius = 0.5, Shadow Rays = 10 (similar to area light) Compare • Depth map shadows create soft edges by blurring • Ray-traced shadows simulate a more natural softening with distance Point light, depth-mapped shadow Point light, ray-traced shadow Area lights & Ray Traced shadows • Increase number of shadow rays (1, 5, 20) Depth Map Shadows