nick anastas n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Shading models PowerPoint Presentation
Download Presentation
Shading models

Loading in 2 Seconds...

play fullscreen
1 / 18

Shading models - PowerPoint PPT Presentation


  • 150 Views
  • Uploaded on

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.

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

PowerPoint Slideshow about 'Shading models' - shelby


Download Now 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.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
outline

Virtual Objects

  • Phong Reflection Model
  • Basic Shading Models
  • Advanced Shading Models
Outline
objects

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
normal vector t b too

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)
phong reflection model1

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
basic shading models

Three basic models

    • Flat Shading
    • Gouraud Shading
    • Phong Shading
Basic Shading Models
flat shading

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
gouraud shading

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
gouraud shading1

Looks much better than flat shading

  • Easy to calculate
  • Small specular highlights are easily missed
Gouraud Shading
phong shading

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
phong shading1

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

  • Still looks good
Phong Shading
normal map shader

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
normal mapping

Get relatively detailed-looking objects for little extra cost

  • Object boundaries will reveal the use of a normal map
Normal Mapping
environment map shader

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
environment map shader1

Much cheaper than ray tracing

  • Although the reflection is not perfect, it is often ‘good enough’
Environment map shader