Presentation is loading. Please wait.

Presentation is loading. Please wait.

Shading Adding Color Lambert’s law n L  Light a point in any direction varies as the cosine of the angle between a vector from the point to the light.

Similar presentations


Presentation on theme: "Shading Adding Color Lambert’s law n L  Light a point in any direction varies as the cosine of the angle between a vector from the point to the light."— Presentation transcript:

1

2 Shading

3 Adding Color

4 Lambert’s law n L  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

5 Warnock (Flat) Shading Flat shading Decrease intensity with distance from light and object Highlights

6 Gouraud Shading Compute shading at each vertex Interpolate shading

7 Problem with Gouraud Shading Highlights across polygons

8 Phong Shading

9

10 Diffuse Shading n L  eye I diffuse = k d I light cos 

11 Specular Shading n L  e r  Add specular by looking at reflection, r Shiny surfaces, such as a mirror

12 Phong Shading n L  e r  i = 1 lights I total = k a I ambient +  I i ( k d (N. L) + k s (V. R) n shiney )

13 Phong Shading n L  e r 

14 Review: Surface Properties Perfectly Specular: “Mirror” “infinite gloss” Phong Specular Model: L R cos  (  ) Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics”  Incident Light Ray Surface Normal Reflected Light

15 Review: Surface Properties Slightly scattered Specular: “high gloss” Phong Specular Model: L R cos 15 (  ) L R cos 15 (  ) Incident Light Ray Surface Normal Reflected Light Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics”

16 Review: Surface Properties More Scattered Specular: “medium gloss” Phong Specular Model: L R cos 5 (  ) L R cos 5 (  ) Incident Light Ray Surface Normal Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics”

17 Review: Surface Properties Perfectly Diffuse “flat”, “chalky”,… Incident Light Ray Surface Normal Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics”

18 Review: Surface Properties Most Materials: Combination of Diffuse and Specular Incident Light Ray Surface Normal Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics”

19 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 * [ ambient light *ambient material + (max { L · n, 0} ) * diffuse light * diffuse material + (max { s · n, 0} )shininess * specular light * specular material ] i n-1

20 Rendering Realism Cornel Measurement Lab

21 Rendering Realism Real Synthetic Shirley, et. al., cornell

22 Is this real? m fajaro, usc

23 Terrain Modeling: Snow and Trees Added s premoze, et.al., utah

24 Rendering Realism Morning Evening a preetham, et. al., utah

25 Humans Final Fantasy (Sony) Jensen et al.

26 Artistic Shading

27 Is Photorealism Everything?

28

29 Enough Information…?

30 Just a bit more…

31 Or did we mean this…?

32 Diffuse shaded model I = c r ( c a + c l max(0, L. n)) with c r =c l =1 and c a = 0.

33 Just Highlights and Edge Lines

34 Hand-tuned Phong shading

35 From Jose Parramon, 1993

36 Shading used by Artists Complementary ShadingFinal Image From “The Book of Color” by Jose Parramon, 1993

37 Tints, Tones, and Shades Hue White Black Gray tint tone shade From Birren (1976)

38 Creating Tones Green to Gray (tone)

39 Model Shaded using Tones

40 Using Color Temperature Warm to Cool Hue Shift

41 Constant Luminance Tone Rendering

42 Creating Undertones Warm to Cool Hue Shift Green with Warm to Cool Hue Shift

43 Model tone shaded with cool to warm undertones

44 Combining Tones with Undertones Green with Tone and Undertone

45 Model shaded with tones and undertones

46

47

48 Phong Shaded Spheres

49 Spheres with New Shading

50 Phong Shading Formula c = c r (c a + c l max(0, L. n ) ) + c l c p cos ( h. n ) n

51 New Shading Formula I = k w c warm + (1 - k w ) c cool where k w = (1 + (L. n) )*.5)

52 New Shading

53 OpenGL Approximation Without Highlights Light RGB Intensities L 1 = (0.5, 0.5, 0.0) L 2 = (-0.5, -0.5, 0)

54 OpenGL Approximation With highlights Without Highlights

55 Warm to Cool Shading Phong Shaded New Shading Without Edge Lines New Shading With Edge Lines

56 Toon Shading Intel: http://www.intel.com/labs/media/3dsoftware/nonphoto.htm

57 Toon Shading Nvidia: developer.nvidia.com/object/Toon_Shading.html

58 Toon Shading Blender: w3imagis.imag.fr/Membres/Jean-Dominique.Gascuel/DEAIVR/ Cours2002/17%20janvier/Blender-tutorial80.pdf

59 Non-Photorealistic Rendering b gooch, et.al., utah

60 NonPhotorealistic Rendering

61 Shading in Maya

62 Hypershade Shading models = Materials

63 Material Types Lambert –Flat, matte, diffuse, rough surface –Reflection greatest where surface orientation is coincident with light direction

64 Material Types

65 Phong –Shiny, glossy, smooth surface –Lambert + highlight

66 Material Types PhongE –Similar to Phong, but with softer highlight –Renders slightly faster than Phong

67 Material Types Blin –Simulating metallic surfaces –More control over highlight

68 Material Types Anisotropic –Simulates small, invisible grooves

69 Material Attributes Color

70 Material Attributes Transparency

71 Material Attributes Ambient color – adds color to all parts of the object Add deep purple

72 Material Attribute Incadenscence –Simulate light being reflect from object itself Does not actually affect other objects Adding slight dark green incandescence:

73 Material Attribute Translucence –Light pass thru opaque material 0.00.6

74

75

76 Ray Tracing http://www.cs.berkeley.edu/~efros/java/tracer/tracer.h tmlhttp://www.cs.berkeley.edu/~efros/java/tracer/tracer.h tml http://www.siggraph.org/education/materials/HyperGr aph/raytrace/rt_java/raytrace.htmlhttp://www.siggraph.org/education/materials/HyperGr aph/raytrace/rt_java/raytrace.html

77 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)

78 Shadow Properties Color Softness: Gradiation/blurring of shadow edges Graininess: smoothness of shadow edge

79 Depth Map shadows Per light, shadows section, attribute editor > Use Depth Map

80 Depth map Properties: Graininess Shadows attribute > Dmap resolution (on light) Higher resolution increases rendering time Dmap resolution 256 512

81 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

82 Trouble Shooting Dmap http://woodall.ncsa.uiuc.edu/dbock/Class/cs c187/Lecture/LightingAndShadows.html

83 Ray-traced shadows Per light, shadows section, attribute editor – Use Ray Trace Shadows Window->Render Globals, Raytracing quality, turn on raytracing

84 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)

85 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

86 Area lights & Ray Traced shadows Increase number of shadow rays (1, 5, 20)

87 Depth Map Shadows

88

89 Surface mapping Texture mapping Bump Mapping Displacement mapping –Actually moving geometry –ie Create screw from cylinder, Terrain, etc

90 What does a pixel see? From Tomas Akenine-Moller

91 Controlling Filtering

92 From Tomas Akenine-Moller Repeat, Mirror, Clamp, Border

93 Mipmapping Image pyramid Half height and width Compute d –Gives 2 images Bilinear Interpolate in each image From Tomas Akenine-Moller

94 MipMapping Memory Requirements

95 Environment Mapping Assume environment infinitely far away Sphere mapping Cube mapping (now norm) –No singularities –Much less distortion –Better result –Not dependent on view position

96 Cube Mapping Simple math: –Compute reflection vector r –Largest abs-value of component determines which cube face 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

97 Bump Mapping + = GeometryBump mapBump mapped geometry

98 Bump Mapping Example

99

100


Download ppt "Shading Adding Color Lambert’s law n L  Light a point in any direction varies as the cosine of the angle between a vector from the point to the light."

Similar presentations


Ads by Google