1 / 18

# Shading models - PowerPoint PPT Presentation

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.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Nick Anastas

Virtual Objects

• Phong Reflection Model
Outline

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

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)

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

Three basic models

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

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

Looks much better than flat shading

• Easy to calculate
• Small specular highlights are easily missed

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

Interpolating the vertex normals (not just intensities) across the triangle fixes Gouraud problem

• Still looks good

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