O'Reilly logo

WebGL Game Development by Sumeet Arora

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

Understanding positional lights

In the scene that we developed in the preceding section, we would like two of the lamps to light up. There is already one global light in the scene but we want two positional lights now.

The directional lights are parallel since they are assumed to be at an infinite distance and are generally the global light in a scene. The intensity of a directional light on a vertex is not dependent on its distance but on its orientation. Hence, only the normal direction is used to calculate its intensity. For positional lights, both the distance and orientation are involved in the intensity calculations.

The difference between directional and positional lights is that the directional lights are defined by a direction vector, whereas ...

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