Deferred lighting

__NOTOC__
Deferred lighting is an alternate lighting technique and modification of deferred shading, a screen-space shading technique that allows many lights to be rendered on the scene without significant performance hit.
It is much different from the default (usually static) Radiosity lighting that comes with . It uses many different lighting passes to generate higher quality lighting, with real time shadows.
 games generally use forward rendering like , but games like and use deferred rendering.
==Differences from vanilla radiosity==
When compiling a map in any of games, each map is run through VRAD (which can take a long time depending on hardware and optimizations), which takes data from all the light sources and compile them into a lightmap texture. While this does provide high-quality and variable lighting, it is completely static, save for the limited ability to toggle on some lights in a scene. The difference between radiosity and deferred lighting is that deferred lighting computes all its lights in real time, with low performance cost (cheap). The game takes data from the normals of the object, its geometry, its albedo, and its specular lighting to create real time accurate lighting.
==Differences with dynamic lights on forward rendering==
When using dynamic light entities like (also used on player's flashlight since ), on forward renderer, it can significantly reduce performance if there are too many of them. Other dynamic lights such as , also reduces performance if the lightmap has small luxel scale and/or the light having custom appearance (lightstyles). Additionally, is also limited by the engine itself (by default), meaning that it only works properly with one entity, without engine modifications. Deferred lighting (and deferred shading) does not have these issues or limitations and almost infinite numbers of dynamic lights can be active, with less performance loss than forward renderer.
===Features===
*Quite cheap realtime lighting and shadows
*Almost infinite number of dynamic lights that can be active (stock Source only allows for one at a time)
*High-fidelity Godrays
*Volumetric lighting
*Light cookies (premade shadow maps)
===Drawbacks===
*Traditional antialiasing like MSAA might not work with it like in (which was removed and replaced with FXAA because MSAA combined with deferred lighting caused certain models to have glowing outline around it), but it depends how it was implemented into the game. As with , and is still supported, through it's recommended that you should use post-processing anti-aliasing method instead as they work best with deferred lighting, and has less performance hit. MSAA are also more demanding with deferred lighting/shading compared to forward rendering.
*All lightmaps are disabled and only deferred lighting lights the world. 
*Can be more taxing on older systems.
*DX9 SM3 or later only, older DirectX compatibility versions are not supported.
==Media==
==Availability==
=== Source ===
Very few games utilize this lighting technique, as it is very complicated to implement, the games that do use this are listed here:
* 
*
*
*
* (including ) - using Deferred shading
* (Lighting Preview in Stock HL2 and )
=== Source 2 ===
* 
* 
* 
==Tutorials==
* Implementing Deferred lighting into Source 2013
== See also ==
* 
* Light editor
* Volumetric lighting
* 
* 
* 
* 
* (Wikipedia)
==External links==
* Deferred Shading on LearnOpenGL (basics)
Category:Graphics
Category:Shaders
Category:Glossary
Category:Technical