Deferred shading
Encyclopedia
In computer graphics
Computer graphics
Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware....

, deferred shading is a three dimensional
3D computer graphics
3D computer graphics are graphics that use a three-dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images...

 shading
Shading
Shading refers to depicting depth perception in 3D models or illustrations by varying levels of darkness.-Drawing:Shading is a process used in drawing for depicting levels of darkness on paper by applying media more densely or with a darker shade for darker areas, and less densely or with a lighter...

 technique in which the result of a shading algorithm is calculated by dividing it into smaller parts that are written to intermediate buffer storage (called G-buffer) to be combined later, instead of immediately writing the shader result to the color framebuffer. Implementations on modern hardware tend to use multiple render targets (MRT
Multiple Render Targets
In the field of 3D computer graphics, Multiple Render Targets, or MRT, is a feature of modern graphics processing units that allows the programmable rendering pipeline to render images to multiple render target textures at once. These textures can then be used as inputs to other shaders or as...

) to avoid redundant vertex transformations. Usually once all the needed buffers are built they are then read (usually as input textures) into a shading algorithm (for example a lighting equation) and combined to produce the final result. In this way the computation and memory bandwidth required to shade a scene is reduced to those visible portions, thereby reducing the shaded depth complexity.

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 scene without significant performance-hit. There are some other advantages claimed for the approach. These advantages may include the 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 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 eats up big amount of the memory bandwidth.

One more rather important disadvantage is that, due to separating the lighting stage from the geometric stage, hardware anti-aliasing
Anti-aliasing
In digital signal processing, spatial anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution image at a lower resolution...

 does not produce correct results any more: although the first pass used when rendering the basic properties (diffuse, normal etc.) can use anti-aliasing
Anti-aliasing
In digital signal processing, spatial anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution image at a lower resolution...

, it's not until full lighting has been applied that anti-alias is needed. One of the usual techniques to overcome this limitation is using edge detection
Edge detection
Edge detection is a fundamental tool in image processing and computer vision, particularly in the areas of feature detection and feature extraction, which aim at identifying points in a digital image at which the image brightness changes sharply or, more formally, has discontinuities...

 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
Killzone 3
Killzone 3 is a 2011 first-person shooter 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 be presented in 3D and the first to include motion controls using the...

 and Dragon Age 2, among others), FXAA (used in Crysis 2
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...

, FEAR 3, Duke Nukem Forever
Duke Nukem Forever
Duke Nukem Forever is a 2011 first-person shooter video game for Microsoft Windows, Mac OS X, PlayStation 3 and Xbox 360 developed by 3D Realms and Triptych Games and finished by Gearbox Software and Piranha Games...

), SRAA, DLAA (used in Star Wars: The Force Unleashed II
Star Wars: The Force Unleashed II
Star Wars: The Force Unleashed II is LucasArts' sequel to 2008's Star Wars: The Force Unleashed video game. A trailer announcing the game was shown December 12, 2009, at the Spike Video Game Awards. The game was released across multiple platforms in October 2010, along with a collectors edition of...

), post MSAA (used in Crysis 2
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...

 as default anti-aliasing solution). Another popular technique is Temporal anti-aliasing, used in Halo Reach. DirectX 10 introduced features allowing shaders to access individual samples in multisampled render targets (and depth buffers in version 10.1), making hardware anti-aliasing possible in deferred shading. These features also make it possible to correctly apply HDR luminance mapping to anti-aliased edges, where in earlier hardware any benefit of anti-aliasing may be lost, making this form of anti-aliasing desirable in any case.

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 the attributes necessary to compute per-pixel lighting (irradiance
Irradiance
Irradiance is the power of electromagnetic radiation per unit area incident on a surface. Radiant emittance or radiant exitance is the power per unit area radiated by a surface. The SI units for all of these quantities are watts per square meter , while the cgs units are ergs per square centimeter...

) are written to the G-Buffer. The screen-space, “deferred” pass then outputs only diffuse and specular lighting data, so a second pass must be made over the scene to read back the lighting data and output the final 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 dx9 hardware.

Deferred lighting in commercial games

The techniques is increasingly being used 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
    Alan Wake is a story-driven action game in the psychological thriller genre, developed by Remedy Entertainment and published by Microsoft Game Studios, released for the Xbox 360 video game console in 2010...

  • Bioshock Infinite
    BioShock Infinite
    BioShock Infinite is an upcoming first-person shooter video game, and the third game in the BioShock series. Previously known as "Project Icarus", it is being developed by Irrational Games for a 2012 release on the Microsoft Windows, PlayStation 3 and Xbox 360 platforms...

  • Blur
    Blur (video game)
    Blur is an arcade racing video game for Microsoft Windows, PlayStation 3 and Xbox 360 developed by Bizarre Creations and published by Activision in North America and Europe...

  • Brink
    Brink (video game)
    Brink is a first-person shooter video game developed by Splash Damage for Microsoft Windows, PlayStation 3 and Xbox 360...

  • Crackdown
    Crackdown
    Crackdown is an open world, third-person shooter video game for the Xbox 360. It was released in North America on February 20, 2007, and worldwide by February 23, 2007. Crackdown was developed by Realtime Worlds, and distributed by Microsoft Game Studios. It was conceived by Realtime Worlds...

     and Crackdown 2
    Crackdown 2
    Crackdown 2 is a sandbox-style third-person shooter 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.-Gameplay:...

  • Crysis 2
    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...

  • Dead Space
    Dead Space (video game)
    Dead Space is a survival horror third-person shooter video game, developed by EA Redwood Shores for Microsoft Windows, PlayStation 3 and Xbox 360. The game was made available on Steam on October 20, 2008...

     and Dead Space 2
    Dead Space 2
    Dead Space 2 is a survival horror third-person shooter video game developed by Visceral Games and published by Electronic Arts for Microsoft Windows, PlayStation 3 and Xbox 360. It is the sequel to Dead Space. Unlike its predecessor, Dead Space 2 has a multiplayer mode. A Collector's Edition is...

  • Deus Ex Human Revolution
  • Grand Theft Auto IV
    Grand Theft Auto IV
    Grand Theft Auto IV is a 2008 open world action video game published by Rockstar Games, and developed by British games developer Rockstar North. It has been released for the PlayStation 3 and Xbox 360 video game consoles, and for the Windows operating system...

  • Halo Reach
  • inFamous
    InFamous
    Infamous, stylized as inFAMOUS or inFamous, is an open world video game for the PlayStation 3 video game console. It was developed by Sucker Punch Productions and published by Sony Computer Entertainment...

     and inFamous 2
    Infamous 2
    Infamous 2, stylized as inFAMOUS 2, is a 2011 open world video game for the PlayStation 3 video game console developed by Sucker Punch Productions and published by Sony Computer Entertainment...

  • LittleBigPlanet
    LittleBigPlanet
    LittleBigPlanet, commonly abbreviated LBP, is a puzzle platformer video game, based on user-generated content, for the PlayStation 3 first announced on 7 March 2007, by Phil Harrison at the Game Developers Conference in San Francisco, California...

     and LittleBigPlanet 2
    LittleBigPlanet 2
    LittleBigPlanet 2 is a puzzle platformer video game, centred around user-generated content. The game is developed by Media Molecule, published by Sony Computer Entertainment Europe for PlayStation 3 and was originally scheduled for release in November 2010 but was delayed until January 2011...

  • Shift 2 UNLEASHED
  • Stalker: Shadow of Chernobyl, Clear Sky and Call of Prypiat
  • Red Dead Redemption
  • Resistance series
    Resistance (series)
    Resistance is a science fiction horror series of first-person shooter and third-person shooter video games developed by Insomniac Games and published by Sony Computer Entertainment for the PlayStation 3, PlayStation Portable and PlayStation Vita video game consoles.The series takes place in an...

  • StarCraft II
    StarCraft II
    StarCraft II: Wings of Liberty is a military science fiction real-time strategy video game developed and released by Blizzard Entertainment for Microsoft Windows and Mac OS X. A sequel to the award-winning 1998 video game StarCraft and its expansions, the game was released worldwide on July 27, 2010...

  • Uncharted
    Uncharted
    Uncharted is an award-winning series of action-adventure/platform/third-person shooter video games developed by Naughty Dog and published by Sony Computer Entertainment exclusively for the PlayStation 3 video game console. The series follows modern-day treasure hunter Nathan "Nate" Drake as he...

     and Uncharted 2
  • Vanquish
    Vanquish (video game)
    is a third-person shooter video game developed by Platinum Games and published by Sega for the Xbox 360 and PlayStation 3 video game consoles. The game was released in October 2010, after having been in development since 2007....


Deferred shading in commercial games

In comparison to deferred lighting, this technique is not very popular due to high bandwidth requirements. Especially on consoles, where memory bandwidth is very limited and often a bottleneck.
  • Battlefield 3
    Battlefield 3
    Battlefield 3 is a first-person shooter video game developed by EA Digital Illusions CE and published by Electronic Arts. The game was released in North America on October 25, 2011 and in Europe on October 28, 2011 for Microsoft Windows, PlayStation 3, Xbox 360 and EA Mobile confirmed a port for...

  • Dungeons
  • Killzone 2 and Killzone 3
    Killzone 3
    Killzone 3 is a 2011 first-person shooter 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 be presented in 3D and the first to include motion controls using the...

  • Mafia 2
  • Metro 2033
  • Rift
  • Shrek
    Shrek (video game)
    Shrek is a video game based on the first installment in the popular movie series. It was released exclusively as an Xbox launch title on Wednesday, November 14, 2001.This is the first Shrek video game to be rated T for Teen by the ESRB...

  • Splinter Cell: Conviction
  • Tabula Rasa
  • Trine
    Trine (video game)
    Trine is a side-scrolling action platform and puzzle video game, available for the Microsoft Windows, Linux, Mac OS X and PlayStation Network. It was developed by the Finnish company Frozenbyte, who previously developed the Shadowgrounds series...

  • Viva Pinata
    Viva Piñata
    Viva Piñata is a life simulation game developed by Rare, for the Xbox 360 video game console. The project was headed by Gregg Mayles and the team behind the Banjo-Kazooie series, based on an idea from Tim Stamper. Although rumors of the title circulated among fans for some time, Viva Piñata was...


Deferred techniques in game engines

  • CryEngine 3
  • I-Novae
    I-Novae (game engine)
    The I-Novae engine is the first game engine under development by I-Novae studios. The I-Novae engine incorporates a cutting-edge graphics engine with an advanced terrain engine, soon to be twinned with a complete toolset...

  • Unity
    Unity (game engine)
    Unity is an integrated authoring tool for creating 3D video games or other interactive content such as architectural visualizations or real-time 3D animations. Unity's development environment runs on Microsoft Windows and Mac OS X, and the games it produces can be run on Windows, Mac, Xbox 360,...

  • Frostbite 2
  • Unreal Engine 3
    Unreal Engine 3
    Unreal Engine 3 is a computer game engine developed by Epic Games. It is the third generation of Unreal Engine, designed for DirectX 9/10/11 personal computers , the Xbox 360, the PlayStation 3, the PlayStation Vita, the Wii U, Android and OpenGL-based operating systems such as iOS and Mac OS X...

  • Chrome Engine
    Chrome Engine
    Chrome Engine is a 3D game engine developed by Techland. The current version, Chrome Engine 5, supports Microsoft Windows, Xbox 360, and PlayStation 3.Chrome Engine evolved through over nine years of development...

  • GameStart3D

History

The idea of deferred shading was originally introduced by Michael Deering
Michael Deering
Michael Frank Deering, PhD, is a computer scientist, a former chief engineer for Sun Microsystems in Mountain View, California, and a widely recognized expert on artificial intelligence, computer vision, 3D graphics hardware/software, very-large-scale integration design and virtual reality...

 and his colleagues in a paper published in 1988 entitled 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". 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.

See also

  • S.T.A.L.K.E.R.
  • Killzone 2
  • GameStart Engine
  • Esenthel Engine
  • Leadwerks Engine
    Leadwerks Engine
    The Leadwerks Engine is a 3D game engine powered by OpenGL 2.1. It was designed by Leadwerks Software. Leadwerks Engine 2.0 made its debut in The Game Creators May Newsletter on May 1, 2008. The engine makes use of the Newton Game Dynamics SDK 2.0 for physics, and OpenAL and EAX for sound and 3D...

  • Rockstar Advanced Game Engine
  • Unity Engine
    Unity (game engine)
    Unity is an integrated authoring tool for creating 3D video games or other interactive content such as architectural visualizations or real-time 3D animations. Unity's development environment runs on Microsoft Windows and Mac OS X, and the games it produces can be run on Windows, Mac, Xbox 360,...

  • Havok Vision Engine
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK