Deferred shading.
In a nutshell, you shoot your scene without any lights. Instead, you save the normals and world positions along with textured pixels into several frame buffers (so-called rendering goals). You can do this in one go if you use multiple render extensions.
After you have prepared the buffers, you will begin to display a bunch of full-size ATVs, each of which has a pixel shader program that reads normals and positions and calculates light for one or more light sources.
Since the light is additive, you can display as many full-screen quads as possible, and also accumulate light on as many light sources as you want.
At the last stage, a composition is created between your light and the unlit textured frame buffer.
This is a more or less modern way of doing this. However, the fog and transparency that work with such a system is a problem.
Nils pipenbrinck
source share