illumination model
play

Illumination Model Wireframe rendering simple, ambiguous Color - PowerPoint PPT Presentation

Illumination Model Wireframe rendering simple, ambiguous Color filling flat without any 3D information Requires modeling interaction of light with the object/surface to have a different color (shade) in 3D Illumination Model The reflected


  1. Illumination Model Wireframe rendering simple, ambiguous Color filling flat without any 3D information Requires modeling interaction of light with the object/surface to have a different color (shade) in 3D

  2. Illumination Model The reflected light is scattered depending upon the surface properties and incident light Ambient light comes from all directions, is scattered in all directions Diffuse light comes from one direction and is scattered in all directions Specular light comes from one direction and is scattered in preferred direction

  3. Illumination Model Phong Illumination Model I ambient reflection diffeuse reflection specular reflection = + + total n k I k I cos θ k I cos α = + + a a d l s l n k I k I ( L N ) k I ( R V ) = + • + • a a d l s l m n k I k I ( L N ) k I ( R V ) = + ∑ • + • a a d i i s i i i 1 =

  4. Illumination Model Phong Illumination Model Local computation for obtaining color (intensity) at a point of the surface Basic inputs are light(s), material properties

  5. Polygon Shading Shading Process of applying illumination model to surface points Polygon (approximates the 3D shape/surface) Approaches • Flat Shading • Gouraud Shading • Phong Shading

  6. Polygon Shading Flat Shading One intensity for the whole polygon constant shading For each face/polygon ► Select a point P on the face ► Find normal to the face n p P ► Find intensity I at P n p ► Fill the polygon with I Not smooth

  7. Polygon Shading Flat Shading Example

  8. Polygon Shading Flat Shading • Computationally fast • Not smooth • Mach Band effect

  9. Polygon Shading Gouraud Shading Smooth shading • Compute intensity at vertices of a polygon ð Needs vertex normal • Fill the interior with shade (intensity) using interpolation

  10. Polygon Shading Gouraud Shading Vertex Normal N 4 Normal at the vertex is average of N 2 normals of the faces incident at N v the vertex N 3 n P i N = ∑ v N 1 n i 1 = i

  11. Polygon Shading Gouraud Shading Vertex Normal

  12. Polygon Shading Gouraud Shading Interpolation (x 1 , y 1 ) I 1 Scan line I a I s I b I 4 (x 4 , y 4 ) Scan conversion! (x 2 , y 2 ) I 2 (x 3 , y 3 ) I 3

  13. Polygon Shading Gouraud Shading Interpolation (x 1 , y 1 ) I 1 1 (x a , y s ) (x s , y s ) (x b , y s ) I [ I ( y y ) I ( y y )] = − + − a 1 s 2 2 1 s y y − Scan line I a I s I b I 4 1 2 1 I [ I ( y y ) I ( y y )] (x 4 , y 4 ) = − + − b 1 s 4 4 1 s y y (x 2 , y 2 ) − 1 4 1 I 2 I [ I ( x x ) I ( x x )] = − + − s a b s b s a x x − b a (x 3 , y 3 ) I 3

  14. Polygon Shading Gouraud Shading Example

  15. Polygon Shading Gouraud Shading Handling Specular Reflections- Highlights Not Right

  16. Polygon Shading Phong Shading Interpolate normals and then compute intensity Not to confuse with Phong Illumination Model

  17. Polygon Shading Phong Shading (x 1 , y 1 ) N 1 Illumination using N s Scan line N s I s N a N s N b N 4 (x 4 , y 4 ) (x 2 , y 2 ) N 2 (x 3 , y 3 ) N 3

  18. Polygon Shading Phong Shading • More accurate specular component • Reduced Mach band effect • Better shape approximation N 1 N 2 Original surface Computationally more intensive

  19. Polygon Shading Phong Shading Example

  20. Polygon Shading Phong Shading Example

  21. Polygon Shading Problems Interpolated shading Polygon Silhouette

  22. Polygon Shading Problems Interpolated shading Interpolation Inaccuracy (screen space vs world space) Linear Interpolation Perspective Interpolation

  23. Polygon Shading Problems Interpolated shading Animation V 1 V 2 Rotate P P V 3 V 1 V 4 V 2 V 4 V 3

  24. Polygon Shading Problems Interpolated shading Vertex Normal Vertex Normals Face Normals

  25. Polygon Shading Graphics Pipeline Order Illumination computation is done early after modeling transformation Shading is done towards the end with rasterization (scan conversion)

  26. Polygon Shading Transparency Simple Model Non refractive I kI ( − 1 k ) I = + reflected transmitte d k is the opacity factor (coefficient)

Recommend


More recommend