![Deferred rendering pass col](https://upload.wikimedia.org/wikipedia/commons/7/7a/Deferred_rendering_pass_col.jpg)
![Deferred rendering pass dep](https://upload.wikimedia.org/wikipedia/commons/9/92/Deferred_rendering_pass_dep.jpg)
![Deferred rendering pass nor](https://upload.wikimedia.org/wikipedia/commons/0/05/Deferred_rendering_pass_nor.jpg)
![Deferred rendering pass res](https://upload.wikimedia.org/wikipedia/commons/f/f3/Deferred_rendering_pass_res.jpg)
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 shading
Shading refers to the depiction of depth perception in 3D models (within the field of 3D computer graphics) or illustrations (in visual art) by varying the level of darkness. Shading tries to approximate local behavior of light on the object's ...
technique that is performed on a second
rendering pass, after the vertex and pixel
shader
In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of spec ...
s 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
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
...
". After this, a
pixel shader
In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the Rendering (computer graphics), rendering of a 3D scene - a process known as ''shading''. Shaders have evolved ...
computes the direct and indirect lighting at each pixel using the information of the
texture buffers in
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
...
.
Screen space directional occlusion
Screen space directional occlusion (SSDO) is a computer graphics technique enhancing screen space ambient occlusion (SSAO) by taking direction into account to sample the ambient light (both the light coming directly at an object, as well as the l ...
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 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 can be used to achieve
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 sorted order for alpha compositing.
Description
Commonly, 3D g ...
in deferred rendering, but at the cost of additional batches and g-buffer size. Modern hardware, supporting
DirectX 10
Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct" ...
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 Anti-aliasing may refer to any of a number of techniques to combat the problems of aliasing in a sampled signal such as a digital image or digital audio recording.
Specific topics in anti-aliasing include:
* Anti-aliasing filter, a filter used be ...
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
Edge detection includes a variety of mathematical methods that aim at identifying edges, curves in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. The same problem of finding discontinuitie ...
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
Morphological antialiasing (MLAA) is a technique for minimizing the distortion artifacts known as aliasing when representing a high-resolution image at a lower resolution.
Contrary to multisample anti-aliasing (MSAA), which does not work for def ...
(used in ''
Killzone 3
''Killzone 3'' is a 2011 first-person shooter video game for the PlayStation 3, developed by Guerrilla Games and published by Sony Computer Entertainment. It is the fourth installment in the ''Killzone'' series, the first game in the series to ...
'' and ''
Dragon Age II
''Dragon Age II'' is a 2011 action role-playing video game developed by BioWare and published by Electronic Arts (EA). It is the second major game in the ''Dragon Age'' series and the successor to '' Dragon Age: Origins'' (2009). Set in the wor ...
'', among others),
FXAA
Fast approximate anti-aliasing (FXAA) is a screen-space Spatial anti-aliasing, anti-aliasing algorithm created by Timothy Lottes at Nvidia.
FXAA 3 is released under a public domain license. A later version, FXAA 3.11, is released under a 3-clause ...
(used in ''
Crysis 2
''Crysis 2'' is a first-person shooter video game developed by Crytek, published by Electronic Arts and released in North America, Australia and Europe in March 2011 for Microsoft Windows, PlayStation 3, and Xbox 360. Officially announced on Jun ...
'', ''
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
''Crysis 2'' is a first-person shooter video game developed by Crytek, published by Electronic Arts and released in North America, Australia and Europe in March 2011 for Microsoft Windows, PlayStation 3, and Xbox 360. Officially announced on Jun ...
'' as default anti-aliasing solution). Although it is not an edge-smoothing technique,
temporal anti-aliasing
Temporal anti-aliasing (TAA) is a spatial anti-aliasing technique for computer-generated video that combines information from past frames and the current frame to remove jaggies in the current frame. In TAA, each pixel is sampled once per frame but ...
(used in ''
Halo: Reach and
Unreal Engine
Unreal Engine (UE) is a 3D computer graphics game engine developed by Epic Games, first showcased in the 1998 first-person shooter game ''Unreal''. Initially developed for PC first-person shooters, it has since been used in a variety of genres ...
'') can also help give edges a smoother appearance. DirectX 10 introduced features allowing shaders to access individual samples in multisampled render targets (and
depth buffer
A depth buffer, also known as a z-buffer, is a type of data buffer used in computer graphics to represent depth information of objects in 3D space from a particular perspective. Depth buffers are an aid to rendering a scene to ensure that the ...
s 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
''Alan Wake'' is an action-adventure game developed by Remedy Entertainment. The story follows best-selling thriller novelist Alan Wake as he tries to uncover the mystery behind his wife's disappearance during a vacation in the small fictional ...
''
* ''
Assassin's Creed III
''Assassin's Creed III'' is a 2012 action-adventure video game developed by Ubisoft Montreal and published by Ubisoft for PlayStation 3, Xbox 360, Wii U, and Microsoft Windows. It is the fifth major installment in the ''Assassin's Creed'' serie ...
''
* ''
BioShock Infinite
''BioShock Infinite'' is a first-person shooter video game developed by Irrational Games and published by 2K Games. The third installment in the ''BioShock'' series, ''Infinite'' was released worldwide for the Windows, PlayStation 3, Xbox 360, ...
''
* ''
Blur''
* ''
Brink
Brink or ''variant'', may refer to:
Places
* Brink, Virginia, United States
* Brink, West Virginia, an unincorporated community, United States
* Brink, Greenbrier County, West Virginia, a ghost town, United States
* Brink (norra delen), a loca ...
''
* ''
Crackdown
Crackdown may refer to
* ''Crackdown'' (web series)
* ''Crackdown'' (video game series)
** ''Crackdown'' (video game)
** ''Crackdown 2
''Crackdown 2'' is an open world action-adventure video game developed by Ruffian Games and published by ...
'' and ''
Crackdown 2
''Crackdown 2'' is an open world action-adventure video game developed by Ruffian Games and published by Microsoft Game Studios. It was released on Xbox 360 in July 2010 and is a direct sequel to the 2007 video game '' Crackdown''. A sequel, '' ...
''
* ''
Crysis 2
''Crysis 2'' is a first-person shooter video game developed by Crytek, published by Electronic Arts and released in North America, Australia and Europe in March 2011 for Microsoft Windows, PlayStation 3, and Xbox 360. Officially announced on Jun ...
''
* ''
Dead Space
''Dead Space'' is a science fiction/ horror media franchise created by Glen Schofield and Michael Condrey, developed by Visceral Games, and published and owned by Electronic Arts. The franchise's chronology is not presented in a linear format; ...
'', ''
Dead Space 2
''Dead Space 2'' is a 2011 survival horror game developed by Visceral Games and published by Electronic Arts. It was released for PlayStation 3, Windows, and Xbox 360 in January. The second mainline entry in the ''Dead Space (franchise), Dead Spa ...
'' and ''
Dead Space 3
''Dead Space 3'' is a 2013 survival horror action video game developed by Visceral Games and published by Electronic Arts for Microsoft Windows, PlayStation 3 and Xbox 360. It is the third and final main entry in the ''Dead Space'' series. The ...
''
* ''
Deus Ex: Human Revolution''
* ''
Dragon's Dogma
''Dragon's Dogma'' is an action role-playing hack and slash video game developed and published by Capcom for PlayStation 3 and Xbox 360 in 2012. An enhanced version titled ''Dragon's Dogma: Dark Arisen'' was released for the game's original consol ...
''
* ''
Guild Wars 2
''Guild Wars 2'' is a free-to-play, massively multiplayer online role-playing game developed by ArenaNet and published by NCSoft. Set in the fantasy world of Tyria, the core game follows the re-emergence of Destiny's Edge, a disbanded guild ded ...
''
* ''
Halo: Reach''
* ''
inFamous
Infamous may refer to:
Arts, entertainment and media Film and television
* ''Infamous'' (2006 film), an American drama film
* ''Infamous'' (2020 film), an American crime thriller film
* "Infamous", an episode of ''Lego Ninjago: Masters of Spinj ...
'' and ''
inFamous 2
''Infamous 2'' (stylized as ''inFAMOUS 2'') is an action-adventure video game developed by Sucker Punch Productions and published by Sony Computer Entertainment for PlayStation 3 video game console. It is a sequel to the 2009 video game '' Infa ...
''
* ''
LittleBigPlanet
''LittleBigPlanet'' (stylized as ''LittleBIGPlanet''; abbreviated ''LBP'') is a puzzle platform video game series created and produced by British developer Media Molecule and published by Sony Interactive Entertainment. Most games in the series ...
''
* ''
Metal Gear Solid V: Ground Zeroes''
* ''
Metal Gear Solid V: The Phantom Pain''
* ''
Shift 2 UNLEASHED
''Shift 2: Unleashed'' (also known as ''Need for Speed: Shift 2 – Unleashed'') is a simcade racing video game, the seventeenth installment of the ''Need for Speed'' series. It was developed by Slightly Mad Studios and published by Electronic ...
''
* ''
Red Dead Redemption
''Red Dead Redemption'' is a 2010 action-adventure game developed by Rockstar San Diego and published by Rockstar Games. A spiritual successor to 2004's ''Red Dead Revolver'', it is the second game in the ''Red Dead'' series. ''Red Dead Redempt ...
''
* ''
Resistance series''
* ''
Rochard''
* ''
StarCraft II
''StarCraft II'' is a military science fiction video game created by Blizzard Entertainment as a sequel to the successful ''StarCraft'' video game released in 1998. Set in a fictional future, the game centers on a galactic struggle for dominance ...
''
* ''
Uncharted
''Uncharted'' is an action-adventure video game franchise published by Sony Interactive Entertainment and developed by Naughty Dog. Created by Amy Hennig, the ''Uncharted'' franchise follows a group of treasure hunters who travel across the wo ...
'' and ''
Uncharted 2''
* ''
Vanquish''
* ''
Ghost of Tsushima
''Ghost of Tsushima'' is a 2020 action-adventure game developed by Sucker Punch Productions and published by Sony Interactive Entertainment. The player controls Jin Sakai, samurai on a quest to protect Tsushima Island during the first Mongol ...
''
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
''Battlefield 3'' is a 2011 first-person shooter video game developed by DICE (company), DICE and published by Electronic Arts for Windows, Microsoft Windows, PlayStation 3 and Xbox 360. It is a direct sequel to 2005's ''Battlefield 2''.
In ''B ...
''
* ''
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
A dungeon is a room or cell in which prisoners are held, especially underground. Dungeons are generally associated with medieval castles, though their association with torture probably belongs more to the Renaissance period. An oubliette (from ...
''
* ''
Digital Combat Simulator (DCS) World 2.5''
* ''
Grand Theft Auto IV
''Grand Theft Auto IV'' is a 2008 action-adventure game developed by Rockstar North and published by Rockstar Games. It is the sixth main entry in the ''Grand Theft Auto'' series, following 2004's '' Grand Theft Auto: San Andreas'', and the ...
''
* ''
Killzone 2
''Killzone 2'' is a 2009 first-person shooter developed by Guerrilla Games and published by Sony Computer Entertainment for the PlayStation 3. It is the second main installment in the ''Killzone'' series, following 2004's '' Killzone''.
Simil ...
'' and ''
Killzone 3
''Killzone 3'' is a 2011 first-person shooter video game for the PlayStation 3, developed by Guerrilla Games and published by Sony Computer Entertainment. It is the fourth installment in the ''Killzone'' series, the first game in the series to ...
''
* ''
Mafia II
''Mafia II'' is a 2010 action-adventure game developed by 2K Czech and published by 2K Games. It was released in August 24 2010 for PlayStation 3, Windows, and Xbox 360. The game is a standalone sequel to 2002's ''Mafia (video game), Mafia'', an ...
''
* ''
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 Metro 2033 may refer to:
* ''Metro 2033'' (novel), a 2002 novel by Russian author Dmitry Glukhovsky
* ''Metro 2033'' (video game), a 2010 first-person shooter video game based on the novel
See also
* ''Metro'' (franchise), originating from t ...
''
* ''
Rift
In geology, a rift is a linear zone where the lithosphere is being pulled apart and is an example of extensional tectonics.
Typical rift features are a central linear downfaulted depression, called a graben, or more commonly a half-grabe ...
''
* ''
Shrek
''Shrek'' is a 2001 American computer-animated comedy film loosely based on the 1990 book of the same name by William Steig. It is the first installment in the ''Shrek'' franchise. The film was directed by Andrew Adamson and Vicky Jenso ...
''
* ''
Splinter Cell: Conviction''
* The ''
S.T.A.L.K.E.R.
''S.T.A.L.K.E.R.'' is a first-person-shooter survival horror video game series developed by GSC Game World. The series is set in an alternate version of the present-day Chernobyl Exclusion Zone in Ukraine, where, according to the series' backs ...
'' game series: ''
Shadow of Chernobyl'', ''
Clear Sky'' and ''
Call of Pripyat''
* ''
Tabula Rasa
''Tabula rasa'' (; "blank slate") is the theory that individuals are born without built-in mental content, and therefore all knowledge comes from experience or perception. Epistemological proponents of ''tabula rasa'' disagree with the doctri ...
''
* ''
Trine''
* ''
Trine 2
''Trine 2'' is a side-scrolling, puzzle-platform game developed by Frozenbyte. It is the sequel to '' Trine'' and was released on Microsoft Windows, OS X, PlayStation 3, and Xbox 360 in December 2011, and later for Linux in March 2012. ''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
Ubisoft Anvil (until 2009 known as Scimitar and until 2020 as AnvilNext) is a game engine created by Ubisoft Montreal and used in 2007 game ''Assassin's Creed''. The engine is used on Microsoft Windows, Nintendo Switch, PlayStation 3, PlayStatio ...
''
* ''
Chrome Engine
Chrome Engine is a proprietary 3D game engine developed by Techland. The current version, Chrome Engine 6, supports Mac OS X, Linux, Xbox One, PlayStation 4, Xbox 360, PlayStation 3 and Microsoft Windows.
Chrome Engine evolved through over ni ...
''
* ''
CryEngine 3
CryEngine (stylized as CRYENGINE) is a game engine designed by the German game developer Crytek. It has been used in all of their titles with the initial version being used in ''Far Cry'', and continues to be updated to support new consoles and ...
''
* ''
Fox Engine''
* ''
Frostbite 2''
* ''
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
Torque Game Engine, or TGE, is an open-source cross-platform 3D computer game engine, developed by GarageGames and actively maintained under the current versions Torque 3D as well as Torque 2D. It was originally developed by Dynamix for the 2001 ...
''
* ''
Unity
Unity may refer to:
Buildings
* Unity Building, Oregon, Illinois, US; a historic building
* Unity Building (Chicago), Illinois, US; a skyscraper
* Unity Buildings, Liverpool, UK; two buildings in England
* Unity Chapel, Wyoming, Wisconsin, US; a h ...
''
* ''
Unreal Engine 4
Unreal Engine (UE) is a 3D computer graphics game engine developed by Epic Games, first showcased in the 1998 first-person shooter game ''Unreal''. Initially developed for PC first-person shooters, it has since been used in a variety of genre ...
''
* ''
Vision
Vision, Visions, or The Vision may refer to:
Perception Optical perception
* Visual perception, the sense of sight
* Visual system, the physical mechanism of eyesight
* Computer vision, a field dealing with how computers can be made to gain un ...
''
* ''
Creation Engine as of Fallout 4 and Skyrim SE''
* ''
Mafia Engine(early Illusion Engine) as of
Mafia III
''Mafia III'' is a 2016 action-adventure video game developed by Hangar 13 and published by 2K Games. It was released in October 2016 for PlayStation 4, Windows, and Xbox One, in May 2017 for macOS, and in October 2021 for Google Stadia. It is ...
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
''Shrek'' is a 2001 American computer-animated comedy film loosely based on the 1990 book of the same name by William Steig. It is the first installment in the ''Shrek'' franchise. The film was directed by Andrew Adamson and Vicky Jenso ...
'', an
Xbox
Xbox is a video gaming brand created and owned by Microsoft. The brand consists of five video game consoles, as well as applications (games), streaming services, an online service by the name of Xbox network, and the development arm by the na ...
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 game
Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, controller, keyboard, or motion sensing device to generate visual feedback. This fee ...
s, finally becoming mainstream around 2008 to 2010.
References
{{Reflist, colwidth=30em
Shading