Develop

Deferred Shading

Updated: Sep 21, 2026

What is Deferred Shading?

Deferred shading is a rendering algorithm where instead of rendering shaded pixels directly (as is done in forward shading), we render a set of textures that represent the material properties of the scene in a base pass. This set of textures is called a Geometry Buffer or GBuffer, and the base pass is often called the GBuffer pass. In a set of lighting passes, we shade the GBuffer. Since the GBuffer contains material properties and geometric information, we can recover all relevant information needed for our lighting computations from the textures themselves. The term deferred comes from the fact that shading is deferred until later. This is not the same as tile-based deferred rendering.
In Unreal Engine, deferred shading supports some visual features that forward shading does not. For example, a rust decal in a decal pass can change the base color, roughness, and metallicness of a surface by modifying the GBuffer. The modified roughness can affect the output of a screen space reflections pass. GBuffers offer a single interface over which many kinds of effects can be composed thus allowing for more complex materials and effects than forward shading. For this reason, most of Unreal Engine also uses deferred shading. Deferred shading unlocks many of Unreal’s rich visual features, including GBuffer decals, Substrate, and screenspace reflections.

Unique Rendering Features

GBuffer Decals

Decals⁠ allow the textures and material properties of surfaces to be modified without adding new materials or geometry. They can be used to add damage, puddles, small details, imperfections, and other effects to surfaces. Decals decouple details from a main asset, allowing content to be composed flexibly. Deferred shading enables an efficient decal algorithm called GBuffer decals.

Screenspace Reflections

Screenspace reflections occur in an expensive deferred shading pass. Its cost scales linearly with the number of pixels covered by a reflective surface. Expect this pass to cost 1-3ms of GPU time on a Quest 3 depending on content. They can be enabled by setting r.Mobile.ScreenSpaceReflections=True and r.SSR.Quality to a nonzero value. Multiview screenspace reflections are only supported on the Meta fork.

Screenspace Ambient Occlusion (SSAO)

SSAO adds subtle darkening in corners where light is less likely to reach, including around dynamic objects. SSAO is extremely expensive, but its cost is not significantly affected by content. At full resolution, expect a frametime increase of 4-5 ms on Quest 3. If much of the scene is static, consider using baked lighting instead to increase performance and battery life.

Performance

Deferred shading is usually more expensive than forward shading. Rendering the GBuffer leads to a higher base cost than forward rendering, but that does not mean it is always more expensive. In deferred shading, screen space reflections, ambient occlusion, and light sources can all be implemented as self-contained passes that access GBuffer data.
Keeping passes small allows them to be better optimized by the shader compiler and hardware. With enough of these passes, deferred shading can be faster than a single large forward pass. In fact, this is one of the main reasons DOOM: The Dark Ages switched to deferred rendering. Whether deferred rendering is actually faster depends on how many of these passes you expect to use in your application.
The only way to truly know whether deferred or forward is faster in your application is to measure. In Unreal Engine, you can switch between forward and deferred shading with a single setting, allowing you to easily measure the cost of both options. However, keep in mind that some performance differences may be caused by the omission of deferred-only rendering features.

Decals

GBuffer Decals are generally cheap, but overuse can still reduce performance. Decals have a geometry processing and shading cost.
Geometry processing cost increases when:
  • More decals appear in the camera frustum, even if they are blocked by other geometry
  • More vertices are used for the mesh in a mesh decal
Shading cost increases when:
  • Decals cover more screen area
  • Decals overlap more
  • Decals modify more material properties
Decals that are hidden by scene geometry do not incur additional shading cost.

Best Practices for Deferred Shading

Deferred shading requires framebuffer fetch to work correctly. It is also compatible with symmetric FoV. This increases performance by preventing the rendering of pixels near the user’s nose, while better aligning tiles between views. Unreal Engine requires mobile HDR when deferred shading is used. Ensure these lines are in your game’s ini file:
r.Mobile.AllowFramebufferFetch=1
xr.ForceSymmetricFov=true
r.Mobile.HDR=true
Enable fixed foveated rendering.
Prefer decals over creating new shaders. By reducing the total number of shaders your application ships with, you spend less time waiting for shaders to compile in editor. Your application also spends less time compiling shaders on user hardware while taking up less space.
When using decals, do not overlap decals and keep mesh decal geometry simple.

Drawbacks Compared to Forward Shading

As discussed earlier, deferred shading may be more expensive than forward shading, especially if a scene is composed of simple materials and a small number of light sources.
Deferred shading also does not support multisample anti aliasing. Another anti-aliasing method must be used.