O'Reilly logo

OpenGL 4.0 Shading Language Cookbook by David Wolff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving realism with prebaked ambient occlusion

The Phong shading model uses a very simplistic model of ambient light. It simply adds a constant value to the shading model everywhere in the scene. This is not very realistic, and leads to a very flat look. In reality, the amount of ambient light that reaches a point on a surface depends on the environment. For example, consider a point in the corner of an empty room versus a point on a flat surface in the middle of a room. Think of ambient light as a light source that emanates from all directions. If the point is in a corner, then the nearby walls block much of the ambient light from reaching that point (if we ignore reflection). Alternatively, if the point is on a flat surface, then almost all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required