O'Reilly logo

OpenGL ES 3.0 Cookbook by Parminder Singh

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

Implementing the per-vertex specular light component

Specular light is responsible for producing shininess on the surface of an object. Unlike diffuse light, which uses the incident ray and surface normal to find the intensity of light, specular light uses the reflected ray and the direction of the viewer to find the intensity of light.

Getting ready

The following figure illustrates the scenario in which the viewer's position (camera) is brought in to the picture to demonstrate the mathematical calculations for specular light. The angle made by the incident ray of light with the normal of the surface is always equal to an angle of reflection with the same normal. Therefore, both S and R vectors create a θ angle with N. The S vector is represented ...

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