BlinnPhong Shading Model and Halfvector - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

BlinnPhong Shading Model and Halfvector

Description:

The size of the specular highlights can be matched in this way very closely to a ... Otherwise specular reflections are computed from the origin of the eye ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 9
Provided by: Hsia
Category:

less

Transcript and Presenter's Notes

Title: BlinnPhong Shading Model and Halfvector


1
BlinnPhong Shading Model and Halfvector
  • ???

2
BlinnPhong Shading Model
  • Also called BlinnPhong reflection model or
    modified Phong reflection model.
  • Trade visual precision for computing efficiency.
  • Default shading model used in OpenGL.

3
Differences (ref wikipedia)
  • The halfway angle is smaller than the angle we
    want in Phong's model, but considering that Phong
    is using, we can set an exponent so that is
    closer to the former expression.
  • The size of the specular highlights can be
    matched in this way very closely to a
    corresponding Phong reflection, but they will
    always retain a subtly different shape.

4
Half-Vector in GLSL
  • Built-in Uniform

Property of a (directional) light!!
5
Halfvector in GLSL
  • Lighting computation is computed in eye space.
  • L (unit vector to light)
  • the same for every fragment for directional light
  • Eye is always (0,0,1) in eye space (camera at
    origin, looking to Z)
  • Halfvector can be computed and stored for
    directional light

See LocalViewer
6
Example
7
GL_LIGHT_MODEL_LOCAL_VIEWER
  • params is a single integer or floating-point
    value that specifies how specular reflection
    angles are computed. If params is 0 (or 0.0),
    specular reflection angles take the view
    direction to be parallel to and in the direction
    of the -z axis, regardless of the location of the
    vertex in eye coordinates. Otherwise specular
    reflections are computed from the origin of the
    eye coordinate system. The default is 0.

8
Summary (Local Viewer)
  • For simplified specular computation (local viewer
    0)
  • Eye (0,0,1)
  • For more sophisticated lighting (local viewer
    1)
  • Eye -ecposition

z
z
H
Eye coord. system
V
L
Write a Comment
User Comments (0)
About PowerShow.com