Deferred shading

Deferred shading
Diffuse Color G-Buffer
Z-Buffer
Normal G-Buffer
Final Compositing

In computer graphics, deferred shading is a three dimensional shading 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) 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.

Contents

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.[1] 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.[2] 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[3].

One more rather important disadvantage is that, due to separating the lighting stage from the geometric stage, hardware anti-aliasing does not produce correct results any more: although the first pass used when rendering the basic properties (diffuse, normal etc.) can use anti-aliasing, 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 on the final image and then applying blur over the edges[4], however recently more advanced post-process edge-smoothing techniques have been developed, such as MLAA[5] (used in Killzone 3 and Dragon Age 2, among others), FXAA[6] (used in Crysis 2, FEAR 3, Duke Nukem Forever), SRAA[7], DLAA[8] (used in Star Wars: The Force Unleashed II), post MSAA (used in Crysis 2 as default anti-aliasing solution). Another popular technique is Temporal anti-aliasing, used in Halo Reach[9]. 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[10]. 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) 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:

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.

Deferred techniques in game engines

History

The idea of deferred shading was originally introduced by Michael Deering and his colleagues in a paper[36] 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,[37] although they too do not use the word "deferred". Around 2004 implementations on commodity graphics hardware started to appear.[38] The technique later gained popularity for applications such as video games, finally becoming mainstream around 2008 to 2010.[39]

References

  1. ^ http://thecansin.com/Files/Deferred%20Rendering%20in%20XNA%204.pdf
  2. ^ "NVIDIA SDK 9.51 - Featured Code Samples". NVIDIA. 2007-01-17. http://download.nvidia.com/developer/SDK/Individual_Samples/featured_samples.html. Retrieved 2007-03-28. 
  3. ^ http://diaryofagraphicsprogrammer.blogspot.com/2008/03/light-pre-pass-renderer.html
  4. ^ "Deferred shading tutorial". Pontifical Catholic University of Rio de Janeiro. http://www710.univ-lyon1.fr/~jciehl/Public/educ/GAMA/2007/Deferred_Shading_Tutorial_SBGAMES2005.pdf. Retrieved 2008-02-14. 
  5. ^ http://igm.univ-mlv.fr/~biri/mlaa-gpu/TMLAA.pdf
  6. ^ http://www.ngohq.com/images/articles/fxaa/FXAA_WhitePaper.pdf
  7. ^ http://research.nvidia.com/publication/subpixel-reconstruction-antialiasing
  8. ^ http://and.intercon.ru/releases/talks/dlaagdc2011/
  9. ^ http://and.intercon.ru/releases/talks/dlaagdc2011/slides/
  10. ^ http://www.realtimerendering.com/blog/deferred-lighting-approaches/
  11. ^ http://gamer.blorge.com/2010/11/21/bioshock-infinite-development-is-ps3-focused-and-uses-uncharted-2-tech/
  12. ^ http://www.eurogamer.net/articles/digitalfoundry-crackdown2-tech-interview
  13. ^ http://www.slideshare.net/guest11b095/a-bit-more-deferred-cry-engine3
  14. ^ "Dead Space by Electronic Arts". NVIDIA. http://nzone.com/object/nzone_deadspace_feature.html. Retrieved 2008-02-14. 
  15. ^ "Face-Off: Dead Space 2". http://www.eurogamer.net/articles/digitalfoundry-dead-space-2-face-off. Retrieved 2010-02-01. 
  16. ^ http://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
  17. ^ http://www.eurogamer.net/articles/digitalfoundry-halo-reach-tech-interview
  18. ^ http://gamer.blorge.com/2010/11/21/bioshock-infinite-development-is-ps3-focused-and-uses-uncharted-2-tech/
  19. ^ http://www.digitalscrutiny.com/content/2011/01/littlebigplanet-2-tech-analysis/
  20. ^ http://www.eurogamer.net/articles/digitalfoundry-the-making-of-shift-2?page=2
  21. ^ Shishkovtsov, Oles (2005-03-07). "GPU Gems 2: Chapter 9. Deferred Shading in S.T.A.L.K.E.R". Nvidia. http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter09.html. Retrieved 2011-02-02. 
  22. ^ http://cmpmedia.vo.llnwd.net/o1/vault/gdc09/slides/gdc09_insomniac_prelighting.pdf
  23. ^ "StarCraft II Effects & techniques" (PDF). AMD. http://developer.amd.com/gpu_assets/S2008-Filion-McNaughton-StarCraftII.pdf. Retrieved 2010-02-28. 
  24. ^ http://features.cgsociety.org/story_custom.php?story_id=5545
  25. ^ http://platinumgames.com/tag/deferred-rendering/
  26. ^ http://www.slideshare.net/DICEStudio/spubased-deferred-shading-in-battlefield-3-for-playstation-3
  27. ^ http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf
  28. ^ http://www.eurogamer.net/articles/digitalfoundry-tech-interview-metro-2033?page=2
  29. ^ "History - Electric Sheep Games". http://www.electricsheepgames.com/games3. Retrieved 14 April 2011. 
  30. ^ "Deferred shading in Tabula Rasa". NVIDIA. http://http.developer.nvidia.com/GPUGems3/gpugems3_ch19.html. Retrieved 2008-02-14. 
  31. ^ "CryENGINE 3 Specifications". Crytek GmbH. http://www.crytek.com/technology/cryengine-3/specifications/. Retrieved 2009-03-12. [dead link]
  32. ^ "Infinity Development Journal – Deferred Lighting". I-Novae Studios. 2009-04-03. http://www.infinity-universe.com/Infinity/index.php?option=com_content&task=view&id=105&Itemid=26. Retrieved 2011-01-26. 
  33. ^ Vosburgh, Ethan (2010-09-09). "Unity 3 Feature Preview – Deferred Rendering". Unity Technologies. http://blogs.unity3d.com/2010/09/09/unity-3-feature-preview-deferred-rendering/. Retrieved 2011-01-26. 
  34. ^ "Lighting you up in Battlefield 3". DICE. March 3rd 2011. http://publications.dice.se/attachments/GDC11_LightingYouUpInBattlefield3.pptx. Retrieved September 15th 2011. 
  35. ^ "Unreal Engine 3 Showcase - Samaritan". Epic Games. 2011-03-10. http://www.udk.com/showcase-samaritan. Retrieved 2011-07-07. 
  36. ^ Deering, Michael; Stephanie Winner, Bic Schediwy, Chris Duffy, Neil Hunt. "The triangle processor and normal vector shader: a VLSI system for high performance graphics". ACM SIGGRAPH Computer Graphics (ACM Press) 22 (4): 21–30. 
  37. ^ Saito, Takafumi; Tokiichiro Takahashi (1990). "Comprehensible rendering of 3-D shapes". ACM SIGGRAPH Computer Graphics (ACM Press) 24 (4): 197–206. doi:10.1145/97880.97901. 
  38. ^ "Deferred Shading" (PDF). NVIDIA. http://download.nvidia.com/developer/presentations/2004/6800_Leagues/6800_Leagues_Deferred_Shading.pdf. Retrieved 2007-03-28. 
  39. ^ Klint, Josh. Deferred Rendering in Leadwerks Engine. Leadwerks. http://www.leadwerks.com/files/Deferred_Rendering_in_Leadwerks_Engine.pdf. 

See also


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Deferred Shading — In der Computergraphik beschreibt Deferred Shading (engl. verzögerte oder aufgeschobene Schattierung) eine Methode, um in dreidimensionalen Szenen die Geometrieverarbeitung, also die Darstellung der physischen Form der Objekte, von der… …   Deutsch Wikipedia

  • Deferred Shading — G Buffer de couleur Z Buffer …   Wikipédia en Français

  • Отложенное освещение и затенение — Отложенное освещение и затенение, отложенный рендеринг (англ. deferred shading) программная техника (методика) в трёхмерной компьютерной графике, которая обрабатывает освещение и затенение визуальной сцены. В результате работы алгоритма… …   Википедия

  • Multiple Render Targets — In the field of 3D computer graphics, Multiple Render Targets, or MRT, is a feature of modern graphics processing units (GPUs) that allows the programmable rendering pipeline to render images to multiple render target textures at once. These… …   Wikipedia

  • Scanline rendering — is an algorithm for visible surface determination, in 3D computer graphics,that works on a row by row basis rather than a polygon by polygon or pixel by pixel basis. All of the polygons to be rendered are first sorted by the top y coordinate at… …   Wikipedia

  • Antialiasing (Computergrafik) — Eine Computergrafik, die oben ohne und unten mit Antialiasing berechnet wurde. Durch Antialiasing wird das harte Erscheinungsbild der Objektkanten geglättet und die dünnen Streifen werden realistischer dargestellt. Antialiasing, auch Anti… …   Deutsch Wikipedia

  • S.T.A.L.K.E.R.: Shadow of Chernobyl — S.T.A.L.K.E.R. redirects here. For the prequel, see S.T.A.L.K.E.R.: Clear Sky. For the sequel, see S.T.A.L.K.E.R.: Call of Pripyat. S.T.A.L.K.E.R.: Shadow of Chernobyl The European cover art for S.T.A.L.K.E.R.: Shadow of Chernobyl …   Wikipedia

  • Computer graphics lighting — refers to the simulation of light in computer graphics. This simulation can either be extremely accurate, as is the case in an application like Radiance which attempts to track the energy flow of light interacting with materials using radiosity… …   Wikipedia

  • CryEngine 3 — Игровой движок (Список) Официальный логотип CryEngine 3 …   Википедия

  • Unity (Spielengine) — Unity Entwickler Unity Technologies Aktuelle Version 3.4.1 (Oktober 2011) Betriebssystem Microsoft Windows, Apple Mac OS X (Entwicklungs und Zielplattformen), PlayStation 3, Xbox (360), Nintendo Wii, iOS …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”