The latest update to the deferred shading implementation is support for point lights, spotlights, and directional lights. Along with these standard light sources we have a fourth light source, unique to deferred shading, used for ambient lighting.

Traditionally ambient lighting is added to the result of the lighting equation when the geometry is initially rendered. However, with deferred shading we separate the geometry from the lighting and only output pixels that are directly affected by a light source. As a result, we have to be sure to account for ambient lighting on geometry that is not directly affected by a standard light source (this is particularly important if we want proper support for light mapping). To accomplish this we have a special lighting pass, implemented using the same methods as the other light sources, that outputs the ambient lighting term at each pixel.

rm_unshadowed rm_deferred
rm_unshadowed rm_deferred

In the above scene we have a point light, spotlight, and directional light emitting red, green, and blue light respectively. The next stage in development is to add support for semi-transparent objects. From a high-level, this will be done by rendering the semi-transparent objects using traditional forward rendering after all deferred shading is completed.