Presentation is loading. Please wait.

Presentation is loading. Please wait.

Smooth Shading Gouraud Phong

Similar presentations


Presentation on theme: "Smooth Shading Gouraud Phong"— Presentation transcript:

1 Smooth Shading Gouraud Phong
CSE 681

2 Interpolate value(s) for point in face from values at vertices
CSE 681

3 Compute normals at vertices
For each vertex, v Nv = <0,0,0> For each face of vertex Compute face normal Nv += face normal Normalize Nv For each vertex, v Nv = <0,0,0> For each face Compute face normal For each vertex of face Nv += face normal Normalize Nv CSE 681

4 Interpolate value(s) for point in face from values at vertices
Gouraud smooth shading: Compute normals at vertices Compute color at vertices Interpolate interior color CSE 681

5 Mach Band Effect Smoothly shaded objects
Colors are continuous, but not derivatives Eye picks up on this and accentuates discontinuity CSE 681

6 Interpolate value(s) for point in face from values at vertices
Phong smooth shading: Compute normals at vertices Interpolate interior normal Compute color at point CSE 681

7 Interpolate value(s) for point in face from values at vertices
CSE 681

8 Interpolate value(s) scanline algorithms
Interpolate down edges, across scanline CSE 681

9 Point sample Quadrilateral inverse binlinear map then use u,v values to interpolate
CSE 681

10 Point sample Triangle compute barycentric coordinates then use to interpolate
Pc b P a c Pa Pb Normalized so that a+b+c=1 P=aPa+bPb+cPc CSE 681

11 Area of a triangle - using vector algebra
Pc Area = (1/2)h|Vab| h = |Vbc |sin(q) h Area = (1/2) |Vab| |Vbc |sin(q) Pa q |Vab x Vbc| = |Vab | |Vbc|sin(q) Pb Area = (1/2) |Vab x Vbc| CSE 681

12 Examples of smooth shading
See links off of course web site CSE 681


Download ppt "Smooth Shading Gouraud Phong"

Similar presentations


Ads by Google