Deferred Lighting
   HOME

TheInfoList



OR:

In the field of
3D computer graphics 3D computer graphics, or “3D graphics,” sometimes called CGI, 3D-CGI or three-dimensional computer graphics are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for th ...
, deferred shading is a
screen-space This is a glossary of terms relating to computer graphics. For more general computer hardware terms, see glossary of computer hardware terms. 0–9 A B ...
shading technique that is performed on a second rendering pass, after the vertex and pixel shaders are rendered. It was first suggested by Michael Deering in 1988. On the first pass of a deferred shader, only data that is required for shading computation is gathered. Positions, normals, and materials for each surface are rendered into the geometry buffer ( G-buffer) using " render to texture". After this, a pixel shader computes the direct and indirect lighting at each pixel using the information of the
texture buffers This is a glossary of terms relating to computer graphics. For more general computer hardware terms, see glossary of computer hardware terms. 0–9 A B ...
in screen space. Screen space directional occlusion can be made part of the deferred shading pipeline to give directionality to shadows and interreflections.


Advantages

The primary advantage of deferred shading is the decoupling of scene geometry from lighting. Only one geometry pass is required, and each light is only computed for those pixels that it actually affects. This gives the ability to render many lights in a scene without a significant performance hit. There are some other advantages claimed for the approach. These advantages may include simpler management of complex lighting resources, ease of managing other complex shader resources, and the simplification of the software rendering pipeline.


Disadvantages

One key disadvantage of deferred rendering is the inability to handle
transparency Transparency, transparence or transparent most often refer to: * Transparency (optics), the physical property of allowing the transmission of light through a material They may also refer to: Literal uses * Transparency (photography), a still ...
within the algorithm, although this problem is a generic one in Z-buffered scenes and it tends to be handled by delaying and sorting the rendering of transparent portions of the scene.
Depth peeling Depth peeling is a method of order-independent transparency Order-independent transparency (OIT) is a class of techniques in rasterisational computer graphics for rendering transparency in a 3D scene, which do not require rendering geometry in so ...
can be used to achieve order-independent transparency in deferred rendering, but at the cost of additional batches and g-buffer size. Modern hardware, supporting DirectX 10 and later, is often capable of performing batches fast enough to maintain interactive frame rates. When order-independent transparency is desired (commonly for consumer applications) deferred shading is no less effective than forward shading using the same technique. Another serious disadvantage is the difficulty with using multiple materials. It's possible to use many different materials, but it requires more data to be stored in the G-buffer, which is already quite large and takes up a large amount of the memory bandwidth. One more disadvantage is that, due to separating the lighting stage from the geometric stage, hardware anti-aliasing does not produce correct results anymore since interpolated subsamples would result in nonsensical position, normal, and tangent attributes. One of the usual techniques to overcome this limitation is using edge detection on the final image and then applying blur over the edges, however recently more advanced post-process edge-smoothing techniques have been developed, such as MLAA (used in '' Killzone 3'' and '' Dragon Age II'', among others), FXAA (used in '' Crysis 2'', '' FEAR 3'', ''
Duke Nukem Forever ''Duke Nukem Forever'' is a 2011 first-person shooter game developed by Gearbox Software and published by 2K Games for Windows, PlayStation 3, and Xbox 360. It is the fourth main installment in the ''Duke Nukem'' series and the sequel to ''Duke ...
'')
SRAADLAA
(used in '' Star Wars: The Force Unleashed II''), and post MSAA (used in '' Crysis 2'' as default anti-aliasing solution). Although it is not an edge-smoothing technique, temporal anti-aliasing (used in '' Halo: Reach and Unreal Engine'') can also help give edges a smoother appearance. DirectX 10 introduced features allowing shaders to access individual samples in multisampled render targets (and depth buffers in version 10.1), giving users of this API access to hardware anti-aliasing in deferred shading. These features also allow them to correctly apply HDR luminance mapping to anti-aliased edges, where in earlier versions of the API any benefit of anti-aliasing may have been lost.


Deferred lighting

Deferred lighting (also known as Light Pre-Pass) is a modification of the Deferred Shading. This technique uses three passes, instead of two in deferred shading. On first pass over the scene geometry, only normals and specular spread factor are written to the color buffer. The screen-space, “deferred” pass then accumulates diffuse and specular lighting data separately, so a last pass must be made over the scene geometry to output final image with per-pixel shading. The apparent advantage of deferred lighting is a dramatic reduction in the size of the G-Buffer. The obvious cost is the need to render the scene geometry twice instead of once. An additional cost is that the deferred pass in deferred lighting must output diffuse and specular irradiance separately, whereas the deferred pass in deferred shading need only output a single combined radiance value. Due to reduction of the size of the G-buffer this technique can partially overcome one serious disadvantage of the deferred shading - multiple materials. Another problem that can be solved is MSAA. Deferred lighting can be used with MSAA on DirectX 9 hardware.


Deferred lighting in commercial games

Use of the technique has increased in video games because of the control it enables in terms of using a large amount of dynamic lights and reducing the complexity of required shader instructions. Some examples of games using deferred lighting are: * '' Alan Wake'' * '' Assassin's Creed III'' * '' BioShock Infinite'' * '' Blur'' * '' Brink'' * ''
Crackdown Crackdown may refer to * ''Crackdown'' (web series) * ''Crackdown'' (video game series) ** ''Crackdown'' (video game) ** '' Crackdown 2'' ** '' Crackdown 3'' * ''Crackdown'' (podcast) * '' The Crackdown'', a 1983 album {{dab ...
'' and '' Crackdown 2'' * '' Crysis 2'' * '' Dead Space'', '' Dead Space 2'' and '' Dead Space 3'' * '' Deus Ex: Human Revolution'' * '' Dragon's Dogma'' * '' Guild Wars 2'' * '' Halo: Reach'' * '' inFamous'' and '' inFamous 2'' * '' LittleBigPlanet'' * '' Metal Gear Solid V: Ground Zeroes'' * '' Metal Gear Solid V: The Phantom Pain'' * '' Shift 2 UNLEASHED'' * '' Red Dead Redemption'' * '' Resistance series'' * ''
Rochard ''Rochard'' is a science fiction platform game available for the PlayStation 3 through the PlayStation Network, for Microsoft Windows, Linux and Mac OS X through the Steam online distribution platform, and for Linux as part of the Humble Indie ...
'' * '' StarCraft II'' * '' Uncharted'' and ''
Uncharted 2 ''Uncharted 2: Among Thieves'' is a 2009 action-adventure game developed by Naughty Dog and published by Sony Computer Entertainment. It is the second game in the ''Uncharted'' series and was released in October 2009 for PlayStation 3. Set two ...
'' * ''
Vanquish Vanquish may refer to: * Aston Martin Vanquish, a grand tourer automobile * Vanquish, a brand name formulation of dicamba pesticide * Vanquish (analgesic) Aspirin(acetylsalicylic acid) / paracetamol(acetaminophen) / caffeine is a combination d ...
'' * '' Ghost of Tsushima''


Deferred shading in commercial games

In comparison to deferred lighting, this technique is not very popular due to high memory size and bandwidth requirements, especially on seventh generation consoles where graphic memory size and bandwidth are limited and often bottlenecks. * '' Amnesia: The Dark Descent'' * '' Battlefield 3'' * ''
Dota 2 ''Dota 2'' is a 2013 multiplayer online battle arena (MOBA) video game by Valve. The game is a sequel to ''Defense of the Ancients'' (''DotA''), a community-created mod for Blizzard Entertainment's '' Warcraft III: Reign of Chaos.'' ''Dota 2' ...
'' * '' Dungeons'' * '' Digital Combat Simulator (DCS) World 2.5'' * '' Grand Theft Auto IV'' * '' Killzone 2'' and '' Killzone 3'' * '' Mafia II'' * ''
Miner Wars 2081 ''Miner Wars 2081'' is a six degrees of freedom action-survival space-shooter simulation game produced by Keen Software House. The gameplay offers a choice of single player, co-op, and deathmatch multi-player. The game is set in the year 2081, ...
'' * '' Metro 2033'' * '' Rift'' * '' Shrek'' * '' Splinter Cell: Conviction'' * The '' S.T.A.L.K.E.R.'' game series: '' Shadow of Chernobyl'', '' Clear Sky'' and '' Call of Pripyat'' * '' Tabula Rasa'' * '' Trine'' * '' Trine 2'' * ''
Viva Pinata Viva may refer to: Companies and organisations * Viva (network operator), a Dominican mobile network operator * Viva Air, a Spanish airline taken over by flag carrier Iberia * Viva Air Dominicana * VIVA Bahrain, a telecommunication company * ...
''


Game engines featuring deferred shading or rendering techniques

* '' AnvilNext'' * '' Chrome Engine'' * '' CryEngine 3'' * ''
Fox Engine The Fox Engine was a proprietary software, proprietary cross-platform, cross-generational game engine built by Kojima Productions (currently Konami Digital Entertainment) for use in Konami games. The engine's development began after the completion ...
'' * ''
Frostbite 2 Frostbite is a game engine developed by DICE, designed for cross-platform use on Microsoft Windows, seventh generation game consoles PlayStation 3 and Xbox 360, eighth generation game consoles PlayStation 4, Xbox One and Nintendo Switch and nin ...
'' * '' GameStart'' * '' Haemimont Games Engine (HGE)'' * ''I-Novae'' * '' Leadwerks'' * ''
MT Framework MT Framework is a game engine created by Capcom. "MT" stands for "Multi-Thread", "Meta Tools" and "Multi-Target". While initially MT Framework was intended to power 2006's ''Dead Rising'' and '' Lost Planet: Extreme Condition'' only, Capcom late ...
'' * ''
Rockstar Advanced Game Engine The Rockstar Advanced Game Engine (RAGE) is a proprietary game engine developed by RAGE Technology Group, a division of Rockstar Games' Rockstar San Diego studio. Since its first game, ''Rockstar Games Presents Table Tennis'' in 2006, released ...
'' * '' Torque 3D'' * '' Unity'' * '' Unreal Engine 4'' * '' Vision'' * ''
Creation Engine The Creation Engine is a 3D video game engine created by Bethesda Game Studios based on the Gamebryo engine. The Creation Engine has been used to create role-playing video games such as '' The Elder Scrolls V: Skyrim'', ''Fallout 4'', and ''F ...
as of Fallout 4 and Skyrim SE'' * '' Mafia Engine(early Illusion Engine) as of Mafia III and Mafia: Definitive Edition''


History

The idea of deferred shading was originally introduced by Michael Deering and his colleagues in a paper published in 1988 titled ''The triangle processor and normal vector shader: a VLSI system for high performance graphics''. Although the paper never uses the word "deferred", a key concept is introduced; each pixel is shaded only once after depth resolution. Deferred shading as we know it today, using G-buffers, was introduced in a paper by Saito and Takahashi in 1990, although they too do not use the word "deferred". The first deferred shaded video game was '' Shrek'', an Xbox launch title shipped in 2001. Around 2004, implementations on commodity graphics hardware started to appear. The technique later gained popularity for applications such as video games, finally becoming mainstream around 2008 to 2010.


References

{{Reflist, colwidth=30em Shading