---
uid: urp-deferred-rendering-path
---
# Deferred Rendering Path in URP
URP Universal Renderer supports the following Rendering Paths:
* Forward
* Forward+
* Deferred
For information on differences between the rendering paths, check the [Rendering Path comparison](../urp-universal-renderer.md#rendering-path-comparison).
This section describes the Deferred Rendering Path.
![Scene rendered with the Deferred Rendering Path](../Images/rendering-deferred/deferred-intro-image.png)
*Sample scene rendered with the Deferred Rendering Path.*
This section contains the following topics:
* [How to select the Deferred Rendering Path](#how-to-enable)
* [Unity Player system requirements](#requirements)
* [Implementation details](#implementation-details)
* [Relevant code files](#relevant-code-files)
* [ShaderLab Pass tags](#shaderlab-pass-tags)
* [Limitations and performance](#limitations-and-performance)
## How to select the Deferred Rendering Path
To select the Rendering Path, use the property **Lighting** > **Rendering Path** in the URP Universal Renderer asset.
![Select the Rendering Path in the URP Universal Renderer asset](../Images/rendering-deferred/urp-renderer-select-deferred-path.png)
When you select the Deferred Rendering Path, Unity shows the [Accurate G-buffer normals](#accurate-g-buffer-normals) property.
The **Accurate G-buffer normals** property lets you configure how Unity encodes the normals when storing them in the geometry buffer (G-buffer).
* **Accurate G-buffer normals** off: This option increases performance, especially on mobile GPUs, but might lead to color banding artifacts on smooth surfaces.
* **Accurate G-buffer normals** on: Unity uses the octahedron encoding to store values of normal vectors in the RGB channel of a normal texture. With this encoding, values of normal vectors are more accurate, but the encoding and decoding operations put extra load on the GPU. This option does not support decal normal blending when used with the [Screen Space decal technique](../renderer-feature-decal.md#screen-space-technique).
For more information about this setting, refer to [Encoding of normals in G-buffer](#accurate-g-buffer-normals).
## Unity Player system requirements
The Deferred Rendering Path has the following requirements and limitations on top of the general system requirements for the Unity Player.
* Minimum Shader Model: Shader Model 4.5.
* Deferred Rendering Path does not support the OpenGL and OpenGL ES API.
If a project with the Deferred Rendering Path is built for platforms using those API, the application falls back to the Forward Rendering Path.
## Implementation details
This section describes the implementation details of this feature, and technical details about how this feature functions.
### G-buffer layout
This section describes how Unity stores material attributes in the G-buffer in the Deferred Rendering Path.
The following illustration shows the data structure for each pixel of the render targets that Unity uses in the Deferred Rendering Path.
![Data structure of the render targets that Unity uses in the Deferred Rendering Path](../Images/rendering-deferred/data-structure-render-targets-g-buffer.png)
The data structure consists of the following components.
**Albedo (sRGB)**
This field contains the albedo color in sRGB format, 24 bits.
**MaterialFlags**
This field is a bit field that contains Material flags:
* Bit 0, **ReceiveShadowsOff**: if set, the pixel does not receive dynamic shadows.
* Bit 1, **SpecularHighlightsOff**: if set, the pixel does not receive specular highlights.
* Bit 2, **SubtractiveMixedLighting**: if set, the pixel uses subtractive mixed lighting.
* Bit 3, **SpecularSetup**: if set, the Material uses the specular workflow.
Bits 4-7 are reserved for future use.
For more technical details, check the file `/ShaderLibrary/UnityGBuffer.hlsl`.
**Specular**
This field contains the following values:
* SimpleLit Material: RGB specular color stored in 24 bits.
* Lit Material with metallic workflow: reflectivity stored in 8 bits, 16 bits are not used.
* Lit Material with specular workflow: RGB specular color stored in 24 bits.
**Occlusion**
This field contains the baked occlusion value from the baked lighting. For real-time lighting, Unity calculates the ambient occlusion value by combining the baked occlusion value with the SSAO value.
**Normal**
This field contains the world space normals encoded in 24 bits. For information on the encoding of normals, refer to [Encoding of normals in G-buffer](#accurate-g-buffer-normals).
**Smoothness**
This field stores the smoothness value for the SimpleLit and Lit materials.
**Emissive/GI/Lighting**
This render target contains the Material emissive output and baked lighting. Unity fills this field during the G-buffer Pass. During the deferred shading pass, Unity stores lighting results in this render target.
Render target format:
* **B10G11R11_UFloatPack32**, unless one of the following conditions is true:
* In URP Asset, the setting **Quality** > **HDR** is turned on, and the target Player platform does not support HDR.
* In Player Settings, the setting **PreserveFramebufferAlpha** is true.
* **R16G6B16A16_SFloat**, if Unity cannot use **B10G11R11_UFloatPack32** because of the project settings.
* If Unity cannot use one of the other formats in the list, it uses what the following method returns: `SystemInfo.GetGraphicsFormat(DefaultFormat.HDR)`.
**ShadowMask**
Unity adds this render target to the G-buffer layout when Lighting Mode is set to Subtractive or Shadow mask.
The Subtractive and the Shadow mask modes are optimized for the Forward Rendering Path, and are less efficient in the Deferred Rendering Path. In the Deferred Rendering Path, avoid using these modes and use the Baked Indirect mode instead to improve GPU performance.
**Rendering Layer Mask**
Unity adds this render target to the G-buffer layout when the Use Rendering Layers option is enabled (URP Asset, **Lighting** > **Use Rendering Layers**).
Using Rendering Layers might have an impact on the GPU performance. For more information, refer to the documentation on [Rendering Layers](../features/rendering-layers.md#performance).
**Depth as Color**
Unity adds this render target to the G-buffer layout when Native Render Pass is enabled on platforms that support it. Unity renders depth as a color into this render target. This render target has the following purpose:
* Improves performance on Vulkan devices.
* Lets Unity get the depth buffer on Metal API, which does not allow fetching the depth from the DepthStencil buffer within the same render pass.
The format of the Depth as Color render target is `GraphicsFormat.R32_SFloat`.
**DepthStencil**
Unity reserves the four highest bits of this render target to mark the Material type. Also check [URP Pass tags: UniversalMaterialType](../urp-shaders/urp-shaderlab-pass-tags.md#universalmaterialtype).
For this render target, Unity selects either the `D32F_S8` format, or the `D24S8` format depending on the platform.
### Encoding of normals in G-buffer
In the Deferred Rendering Path, Unity stores normals in the G-buffer. Unity encodes each normal as a 24 bit value.
When you select the **Deferred** option in the **Rendering Path** property in the URP Universal Renderer asset, Unity shows the **Accurate G-buffer normals** property.
![The Accurate G-buffer normals property in the URP Universal Renderer asset](../Images/rendering-deferred/urp-renderer-accurate-g-buffer-normals.png)
The **Accurate G-buffer normals** property lets you configure how Unity encodes the normals.
* **Accurate G-buffer normals** off: Unity stores values of normal vectors in the G-buffer in the RGB channel of a normal texture, 8 bit per value (x, y, z). The values are quantized with the loss of accuracy. This option increases performance, especially on mobile GPUs, but might lead to color banding artifacts on smooth surfaces.
* **Accurate G-buffer normals** on: Unity uses the octahedron encoding to store values of normal vectors in the RGB channel of a normal texture. With this encoding, values of normal vectors are more accurate, but the encoding and decoding operations put extra load on the GPU. This option does not support decal normal blending when used with the [Screen Space decal technique](../renderer-feature-decal.md#screen-space-technique).
The precision of the encoded normal vectors is similar to the precision of the sampled values in the Forward Rendering Path.
The following illustration shows the visual difference between the two options when the Camera is very close to the GameObject:
![Accurate G-buffer normals, visual difference between the two options.](../Images/rendering-deferred/difference-accurate-g-buffer-normals-on-off.png)
**Performance considerations**
With **Accurate G-buffer normals** option turned on, there is extra load on the GPU because of the encoding and decoding operations. This load is insignificant for desktop platforms and consoles, but might be considerable for mobile GPUs.
Turning the option on does not increase the memory footprint. To store the normals, Unity uses the same RGB channel in the normal texture regardless of the encoding.
### Deferred Rendering Path render Passes
The following table shows the sequence of Render Pass events in the Deferred Rendering Path.
Render Pass events | Deferred Rendering Path Passes | SSAO Renderer Feature Passes |
---|---|---|
BeforeRendering | ||
BeforeRenderingShadows | ||
AfterRenderingShadows | ||
BeforeRenderingPrePasses | Depth, or depth and normal prepass (Forward only materials) | |
AfterRenderingPrePasses | ||
BeforeRenderingGbuffer | G-buffer Pass (GBufferPass) | |
Copy G-buffer depth texture | ||
AfterRenderingGbuffer | SSAO (optional) | |
BeforeRenderingDeferredLights | ||
Deferred rendering (stencil) | ||
AfterRenderingDeferredLights | ||
BeforeRenderingOpaques | Opaque Forward-only Materials | |
AfterRenderingOpaques | SSAO and blending (optional) | |
BeforeRenderingSkybox | ||
AfterRenderingSkybox | ||
BeforeRenderingTransparents | ||
AfterRenderingTransparents | ||
BeforeRenderingPostProcessing | ||
AfterRenderingPostProcessing | ||
AfterRendering |