1 / 18

Shading models

Nick Anastas. Shading models. Virtual Objects Phong Reflection Model Basic Shading Models Advanced Shading Models. Outline. Made of planar polygons Any given planar polygon can be broken down into triangles A triangles is fully defined by providing vertex coordinates and drawing order.

shelby
Download Presentation

Shading models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nick Anastas Shading models

  2. Virtual Objects • Phong Reflection Model • Basic Shading Models • Advanced Shading Models Outline

  3. Made of planar polygons • Any given planar polygon can be broken down into triangles • A triangles is fully defined by providing vertex coordinates and drawing order Objects

  4. The normal vector is extremely important • Unit Vector • Can be formed knowing vertex coordinates and drawing order • Remember the Right Hand Rule! • Tangent & Binormal, too Normal Vector (T & B, too)

  5. Phong Reflection Model

  6. Three types of light • Diffuse: ID = KD * (N•L) • Specular: IS = KS *(R•V)n • Ambient: IA = KA • So… • IP = KD * (N•L) + KS *(R•V)α + KA Phong Reflection Model

  7. Three basic models • Flat Shading • Gouraud Shading • Phong Shading Basic Shading Models

  8. Only 1 normal vector per triangle • Face normal • 1 Intensity value is calculated at location of face normal • This value is used at each pixel on the triangle Flat Shading

  9. Calculate vertex normals • At each vertex, vector add normals from every triangle that has that vertex as one of its own • Unitize the vector sum to derive the vertex normal • Calculate intensity at each vertex • Use the Phong reflection model • Use bilinear interpolation to determine different intensity values at each pixel on the triangle Gouraud Shading

  10. Looks much better than flat shading • Easy to calculate • Small specular highlights are easily missed Gouraud Shading

  11. Not to be confused with the Phong reflection model • Again, vertex normals must be calculated • New normal vectors are calculated at each pixel by interpolating the vertex normals • These new normals are used in the Phong reflection model to calculate different intensity values at each pixel Phong Shading

  12. Interpolating the vertex normals (not just intensities) across the triangle fixes Gouraud problem • Still looks good Phong Shading

  13. Normal Map Shader • Environment Map Shader Advanced Shading Models

  14. Make a nice model and a not-so-nice one • Very high polygon count on the nice model • Record a ‘map’ of the normals of this high-poly model • Replace the normals of the not-so-nice model with those recorded in the map Normal Map Shader

  15. Get relatively detailed-looking objects for little extra cost • Object boundaries will reveal the use of a normal map Normal Mapping

  16. Cube Environment Mapping • Put object in a cube whose inside walls are covered with the desired 2D images • Use the intensity value of the location where the R (reflection) vector of a point intersects the box as that point’s intensity value Environment map shader

  17. Much cheaper than ray tracing • Although the reflection is not perfect, it is often ‘good enough’ Environment map shader

  18. Thank You Questions?

More Related