ArticleslgStudy

science

Deferred shading

Deferred shading is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Deferred shading rather than just read about it. In short: In the field of 3D computer graphics, deferred shading is a screen-space 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.

Deferred shading — main illustration
Deferred shading — illustration

Key takeaways

  • Deferred shading belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Deferred shading to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Deferred shading from memory before moving on to harder problems.

Reference excerpt

In the field of 3D computer graphics, deferred shading is a screen-space 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 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 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 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), 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 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:

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.

Game engines featuring deferred shading or rendering techniques

Raylib X-Ray Engine

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

Illustrations

Deferred shading: Diffuse Color G-Buffer
Diffuse Color G-Buffer
Deferred shading illustration
Deferred shading: Surface Normal G-Buffer
Surface Normal G-Buffer
Deferred shading: Final compositing (To calculate the shadows shown in this image, other techniques such as shadow mapping, shadow feelers or a shadow volume must be used together with deferred shading.)[1]
Final compositing (To calculate the shadows shown in this image, other techniques such as shadow mapping, shadow feelers or a shadow volume must be used together with deferred shading.)[1]

Worked examples

Example 1 — a first encounter with Deferred shading

Start with the simplest possible case. Write down what Deferred shading claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Deferred shading before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Deferred shading ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Deferred shading

In research
Deferred shading appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Deferred shading in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Deferred shading is common in secondary-school and first-year university syllabi. It links to neighbouring topics Shading, so understanding it makes those chapters shorter.
In everyday life
Look for Deferred shading outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Deferred shading” →

How to study Deferred shading in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Deferred shading means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Deferred shading out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Deferred shading in simple terms?

In the field of 3D computer graphics, deferred shading is a screen-space 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.

Why does Deferred shading matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Deferred shading?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Deferred shading.

Tags

  • Shading

Keep exploring