Presentation is loading. Please wait.

Presentation is loading. Please wait.

Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6.

Similar presentations


Presentation on theme: "Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6."— Presentation transcript:

1 Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6 – Raytracing Lab: Mini-proj DUE GDS 6/7 – Raytracing Lab: Your object GP 7 – Texture Mapping GDS 8/9 – Textures + Non-realistic Texturing GP 8 – Viewing transforms GDS 10 – Cameras and Framing GP 9 – Real-Time G.I. GDS 11 – Global Illumination GP 10 – Hidden Surfaces GDS 12/13 – Lighting + Non-real Lighting GDS 14 – Shadows + Non-real Shadows

2 Tesselation and Shading Comptuer Graphics Programming R. Hoetzlein, 2011 Department of Architecture and Media Technology

3 When does the light equation get applied? I = N · L Lets assume the Light (L) is in a constant direction.

4 Object Representation OpenGL uses Polygonal modeling. All objects are approximated by small polygons.

5 Tesselation… Division of surface into polygons. OpenGL does not typically do this step for you..

6 Rasterization… What color is each pixel? We could calculate Phong reflectance model at each pixel.. eg. I = N · L N Question: What is the surface normal at each pixel? pixels polygon

7 What can we say about the surface normals on a flat surface or plane?

8 Rasterization… What color is each pixel? pixels polygon NNNNN

9 Using the face normal for each pixel is called flat shading. Every pixel gets the surface normal of the whole polygon. glShadeModel ( GL_FLAT ); Flat Shading

10 One solution… Increase tesselation… Uses a lot of polygons. To get correct images, polygons must be smaller than a pixel.

11 Gouraud Shading Henri Gouraud (French), 1971 “Continuous shading of curved surfaces” What if we interpolate the intensity across the polygons?

12 Gouraud Shading Flat Shading Notice Mach effect at edges of polygons. Mach Bands are an optical illusion. Our eye notices discontinuous changes in intensity as a jump in brightness.

13 Flat Shading Gouraud Shading two polygons First order discontinuous Second order discontinuous

14 Lets try again… Correct lighting is based on the surface normal.

15 What is the surface normal at this point? How about here?

16 Interpolating the intensity is incorrect, because we are basically guessing intensity instead of using a surface normal… Gouraud Shading N?

17 A vertex connecting two or more faces has a discontinuous normal.

18 Bui Phong Phong Interpolation.. (do not confuse with Phong Reflectance model) What we want to do is, interpolate the surface normal across polygons…

19 Gouraud Shading two polygons Phong Shading

20 Flat Shading Gouraud Shading Phong Shading

21 Flat ShadingNo interpolation. Each pixel uses surface normal of the whole polygon. Gouraud ShadingIntensity interpolation. Each pixel interpolates the intensity of the lighting at the polygon centers. Phong ShadingSurface normal interpolation. Each pixel interpolates the surface normal, and then computes illumination based on that normal. Shading Models

22 Gouraud Shading Phong Shading Flat Shading How many different normals are there? Performance

23 About OpenGL OpenGL implements the: Phong Reflectance Model AND Gouraud Shading OpenGL does not do Phong Shading. Reflectance ModelGives an intensity at a point based on the light vector, normal vector, and other factors. Reflectance model determines how light moves. E.g. Lambert, Phong, Blinn Shading ModelDetermines how to interpolate across polygonal surfaces to make them look smooth. E.g. Flat, Gouraud, Phong shading

24 Shading Models Coke Can Challenge: Which shading model should be used?

25


Download ppt "Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6."

Similar presentations


Ads by Google