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 multiple lights in a scene

So far, all of our recipes are demonstrated using a single light source. This section will help us in implementing multiple lights in a scene. Unlike the fixed pipeline architecture, in which only eight lights can be added to the scene, the programmable pipeline does not impose any upper limit on the number of multiple lights. Adding multiple lights to the scene is very simple. It's similar to the way we added one light position to create one color per-fragment. Now, we add N number of light sources to generate an average of N colors per-fragment:

Implementing multiple lights in a scene

Mathematically, if light sources such as L1, L2, and L3 create ...

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