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 include simpler management of complex lighting resources, ease of managing other complex shader resources, and the simplification of the software rendering pipeline.
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), SRAA, DLAA (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 multi-sampled 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 (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.
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:
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.
"Forward Rendering vs. Deferred Rendering". October 28, 2013. https://gamedevelopment.tutsplus.com/articles/forward-rendering-vs-deferred-rendering--gamedev-12342
Deering, Michael; Stephanie Winner; Bic Schediwy; Chris Duffy; Neil Hunt (1988). "The triangle processor and normal vector shader: A VLSI system for high performance graphics". ACM SIGGRAPH Computer Graphics. 22 (4): 21–30. doi:10.1145/378456.378468. /wiki/Doi_(identifier)
O'Donnell, Yuriy (July 18, 2011). "Deferred Screen Space Directional Occlusion". kayru.org. Archived from the original on October 22, 2012. http://kayru.org/articles/dssdo/
Kayi, Celal Cansin. "Deferred Rendering in XNA 4" (PDF). Linnaeus University. Archived (PDF) from the original on August 13, 2013. Retrieved January 6, 2021. http://homepage.lnu.se/staff/tblma/Deferred%20Rendering%20in%20XNA%204.pdf
"SDK 9.51 – Featured Code Samples". Nvidia. January 17, 2007. Archived from the original on March 8, 2005. Retrieved March 28, 2007. http://download.nvidia.com/developer/SDK/Individual_Samples/featured_samples.html
Engel, Wolfgang (March 16, 2008). "Light Pre-Pass Renderer". Diary of a Graphics Programmer. Archived from the original on April 7, 2008. Retrieved January 6, 2021. /wiki/Wolfgang_Engel
"Deferred shading tutorial" (PDF). Pontifical Catholic University of Rio de Janeiro. Archived from the original (PDF) on March 6, 2009. Retrieved February 14, 2008. https://web.archive.org/web/20090306111435/http://www710.univ-lyon1.fr/~jciehl/Public/educ/GAMA/2007/Deferred_Shading_Tutorial_SBGAMES2005.pdf
"MLAA: Efficiently Moving Antialiasing from the GPU to the CPU" (PDF). Intel. Retrieved December 2, 2018. https://software.intel.com/sites/default/files/m/d/4/1/d/8/MLAA.pdf
"Morphological antialiasing and topological reconstruction" (PDF). Gustave Eiffel University. Archived (PDF) from the original on April 3, 2012. Retrieved January 6, 2021. http://igm.univ-mlv.fr/~biri/mlaa-gpu/TMLAA.pdf
"Archived copy" (PDF). Archived from the original (PDF) on November 25, 2011. Retrieved November 7, 2011.{{cite web}}: CS1 maint: archived copy as title (link) https://web.archive.org/web/20111125073450/http://www.ngohq.com/images/articles/fxaa/FXAA_WhitePaper.pdf
Chajdas, Matthäus G.; McGuire, Morgan; Luebke, David (February 1, 2011). "Subpixel Reconstruction Antialiasing". Nvidia. Archived from the original on January 27, 2011. Retrieved January 6, 2021. http://research.nvidia.com/publication/subpixel-reconstruction-antialiasing
Andreev, Dmitry (2011). "Anti-Aliasing from a Different Perspective". and.intercon.ru. Archived from the original on April 4, 2011. Retrieved January 6, 2021. http://and.intercon.ru/releases/talks/dlaagdc2011/
Andreev, Dmitry (March 4, 2011). "Anti-Aliasing from a Different Perspective (GDC 2011 Extended Slides)". and.intercon.ru. Archived from the original on April 5, 2011. Retrieved January 6, 2021. http://and.intercon.ru/releases/talks/dlaagdc2011/slides/
"Real-Time Rendering · Deferred lighting approaches". realtimerendering.com. June 2, 2009. http://www.realtimerendering.com/blog/deferred-lighting-approaches/
"Assassin's Creed III: The Redesigned Anvil Engine". Game Informer. Archived from the original on March 30, 2012. https://www.gameinformer.com/b/features/archive/2012/03/28/ac-iii-the-redesigned-anvil-engine.aspx
"BioShock Infinite development is PS3 focused and uses Uncharted 2 tech". blorge.com. Archived from the original on October 3, 2011. https://web.archive.org/web/20111003222842/http://gamer.blorge.com/2010/11/21/bioshock-infinite-development-is-ps3-focused-and-uses-uncharted-2-tech/
Chetan Jags (July 18, 2023). "BlackMesa XenEngine: Part 4 – Lighting & Shadows". chetanjags.wordpress.com. Retrieved September 18, 2023. https://chetanjags.wordpress.com/2023/07/18/blackmesa-xenengine-part-4-lighting-shadows/
"Tech Interview: Crackdown 2". Eurogamer.net. June 26, 2010. http://www.eurogamer.net/articles/digitalfoundry-crackdown2-tech-interview
guest11b095 (May 14, 2009). "A Bit More Deferred Cry Engine3". slideshare.net.{{cite web}}: CS1 maint: numeric names: authors list (link) https://www.slideshare.net/guest11b095/a-bit-more-deferred-cry-engine3
"Dead Space by Electronic Arts". NVIDIA. Retrieved February 14, 2008. http://nzone.com/object/nzone_deadspace_feature.html
"Face-Off: Dead Space 2". Eurogamer. Retrieved February 1, 2010. http://www.eurogamer.net/articles/digitalfoundry-dead-space-2-face-off
"Face-Off: Dead Space 3". Eurogamer. February 18, 2013. Retrieved February 18, 2013. http://www.eurogamer.net/articles/digitalfoundry-dead-space-3-face-off
"Google Translate". google.com. https://translate.google.com/translate?hl=en&sl=ja&tl=en&u=http%3A%2F%2Fgame.watch.impress.co.jp%2Fdocs%2Fseries%2F3dcg%2F20100922_395310.html
"GregaMan, Manage Blog". capcom-unity.com. http://www.capcom-unity.com/gregaman/blog/2012/04/05/how_dragons_dogma_changed_the_mt_framework
"Normals". Imgur. http://imgur.com/a/xEtnG
"Tech Interview: Halo: Reach". Eurogamer.net. December 11, 2010. http://www.eurogamer.net/articles/digitalfoundry-halo-reach-tech-interview
"Tech Analysis: Metal Gear Solid 5's FOX Engine". Eurogamer.net. April 5, 2013. http://www.eurogamer.net/articles/digitalfoundry-tech-analysis-mgs5-fox-engine
"Archived copy" (PDF). Archived from the original (PDF) on September 15, 2011. Retrieved July 12, 2011.{{cite web}}: CS1 maint: archived copy as title (link) https://web.archive.org/web/20110915140642/http://cmpmedia.vo.llnwd.net/o1/vault/gdc09/slides/gdc09_insomniac_prelighting.pdf
"The Making of Shift 2 Unleashed Article • Page 2 • Eurogamer.net". Eurogamer.net. May 14, 2011. http://www.eurogamer.net/articles/digitalfoundry-the-making-of-shift-2?page=2
"StarCraft II Effects & techniques" (PDF). AMD. Retrieved July 9, 2012. http://developer.amd.com/wordpress/media/2013/01/Chapter05-Filion-StarCraftII.pdf
"CGSociety Maintenance". cgsociety.org. Archived from the original on April 2, 2015. Retrieved July 12, 2011. https://web.archive.org/web/20150402095240/http://features.cgsociety.org/story_custom.php?story_id=5545
"Deferred Rendering « PlatinumGames Inc". platinumgames.com. Archived from the original on November 27, 2010. https://web.archive.org/web/20101127091253/http://platinumgames.com/tag/deferred-rendering/
"Ghost of Tsushima Analysis: A PS4 Graphics Powerhouse". gamingbolt.com. https://gamingbolt.com/ghost-of-tsushima-analysis-a-ps4-graphics-powerhouse/
Silard Šimon. "Frictional Games interview". playsomnia.com. http://www.playsomnia.com/index.php?option=com_content&view=article&id=863:frictional-games-interview&catid=56:intervjui
DICE (March 8, 2011). "SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3". slideshare.net. https://www.slideshare.net/DICEStudio/spubased-deferred-shading-in-battlefield-3-for-playstation-3
"Valve Developer Wiki - Dota 2". Retrieved April 10, 2012. http://developer.valvesoftware.com/wiki/Dota_2
"Archived copy" (PDF). Archived from the original (PDF) on July 11, 2011. Retrieved July 12, 2011.{{cite web}}: CS1 maint: archived copy as title (link) https://web.archive.org/web/20110711132810/http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf
Miner Wars 2081 /wiki/Miner_Wars_2081
"Tech Interview: Metro 2033 Interview • Page 2 • Eurogamer.net". Eurogamer.net. February 25, 2010. http://www.eurogamer.net/articles/digitalfoundry-tech-interview-metro-2033?page=2
"History - Electric Sheep Games". Retrieved April 14, 2011. http://www.electricsheepgames.com/games3
Shishkovtsov, Oles (March 7, 2005). "GPU Gems 2: Chapter 9. Deferred Shading in S.T.A.L.K.E.R". Nvidia. Retrieved February 2, 2011. http://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter09.html
"Deferred shading in Tabula Rasa". NVIDIA. Archived from the original on February 3, 2009. Retrieved February 14, 2008. https://web.archive.org/web/20090203081102/http://http.developer.nvidia.com/GPUGems3/gpugems3_ch19.html
"Steam Users' Forums - View Single Post - Taking the Physx load off the CPU..." steampowered.com. http://forums.steampowered.com/forums/showpost.php?p=16668774&postcount=5
"Steam Users' Forums - View Single Post - Trine 2 rendering information - anti-aliasing, overheating, stereo, input lag, etc". steampowered.com. http://forums.steampowered.com/forums/showpost.php?p=27599827&postcount=18
"CryENGINE 3 Specifications". Crytek GmbH. Archived from the original on March 27, 2009. Retrieved March 27, 2009. https://web.archive.org/web/20090327231452/http://www.crytek.com/technology/cryengine-3/specifications/
"Tech Analysis: Metal Gear Solid 5's FOX Engine". Eurogamer.net. April 5, 2013. http://www.eurogamer.net/articles/digitalfoundry-tech-analysis-mgs5-fox-engine
"Lighting you up in Battlefield 3". DICE. March 3, 2011. Archived from the original (PDF) on August 25, 2011. Retrieved September 15, 2011. https://web.archive.org/web/20110825085117/http://publications.dice.se/attachments/GDC11_LightingYouUpInBattlefield3.pptx
"GameStart – Feature List". Archived from the original on December 2, 2011. https://web.archive.org/web/20111202181806/http://gamestart3d.com/feature_list
"Infinity Development Journal – Deferred Lighting". I-Novae Studios. April 3, 2009. Archived from the original on January 26, 2013. Retrieved January 26, 2011. https://archive.today/20130126165723/http://www.infinity-universe.com/Infinity/index.php?option=com_content&task=view&id=105&Itemid=26
"BUILD: Deferred rendering". MCV. February 26, 2009. Retrieved April 8, 2015. http://www.develop-online.net/tools-and-tech/build-deferred-rendering/0116368
"Torque 3D Development - Advanced Lighting (deferred lighting hybrid)". March 3, 2009. Retrieved July 2, 2015. http://www.garagegames.com/community/blog/view/16539/
Vosburgh, Ethan (September 9, 2010). "Unity 3 Feature Preview – Deferred Rendering". Unity Technologies. Retrieved January 26, 2011. http://blogs.unity3d.com/2010/09/09/unity-3-feature-preview-deferred-rendering/
"Unreal Engine 4 - Rendering Overview". Epic Games. Retrieved June 6, 2015. https://docs.unrealengine.com/latest/INT/Engine/Rendering/Overview/index.html
"Vision Engine 8.2 Brings 3D Technologies Cross-Platform". October 10, 2011. Archived from the original on November 16, 2012. Retrieved April 8, 2015. https://web.archive.org/web/20121116234611/http://havok.com/news-and-press/releases/vision-engine-82-brings-3d-technologies-cross-platform
"The Graphics Technology of Fallout 4". Bethesda Softworks. November 4, 2015. Retrieved April 24, 2020. https://bethesda.net/en/article/2Y37xeRPeUW0EgkgaKW8oA/the-graphics-technology-of-fallout-4
"raylib [shaders] example - deferred rendering". Raylib community, Justin Andreas Lacoste. October 31, 2023. Retrieved January 1, 2024. https://github.com/raysan5/raylib/blob/master/examples/shaders/shaders_deferred_render.c
Deering, Michael; Stephanie Winner; Bic Schediwy; Chris Duffy; Neil Hunt (1988). "The triangle processor and normal vector shader: A VLSI system for high performance graphics". ACM SIGGRAPH Computer Graphics. 22 (4): 21–30. doi:10.1145/378456.378468. /wiki/Doi_(identifier)
Saito, Takafumi; Tokiichiro Takahashi (1990). "Comprehensible rendering of 3-D shapes". ACM SIGGRAPH Computer Graphics. 24 (4): 197–206. doi:10.1145/97880.97901. /wiki/Doi_(identifier)
Geldreich, Rich. "GDC 2004 Presentation on Deferred Lighting and Shading". Archived from the original on March 11, 2014. Retrieved August 24, 2013. https://web.archive.org/web/20140311040026/https://sites.google.com/site/richgel99/home
"Deferred Shading" (PDF). NVIDIA. Retrieved March 28, 2007. http://download.nvidia.com/developer/presentations/2004/6800_Leagues/6800_Leagues_Deferred_Shading.pdf
Klint, Josh. "Deferred Rendering in Leadwerks Engine" (PDF). Leadwerks. Archived from the original (PDF) on December 9, 2008. https://web.archive.org/web/20081209174351/http://www.leadwerks.com/files/Deferred_Rendering_in_Leadwerks_Engine.pdf