What is Variable Rate Shading?
What is Variable Rate Shading?
Variable Rate Shading is a technique to reduce pixel shader workloads and was introduced with DirectX12 Ultimate.
It combines blocks of pixels to perform a single pixel shader operation. The result is then used for the entire block of pixels. This can help reduce GPU workloads for a variety of render passes such as Basepass and Translucency.
This technique works best on pixels with low contrast with neighboring pixels such as Fog, Sky, Snow, Sand, etc. In practice you'll find that a lot of materials will at least have certain areas with low contrast, especially while inside shadows where no specular highlights are present and the contrast is naturally lower.
When combining this with other systems such as TSR or Dynamic Resolution you may find that the internal resolution can be bumped up thanks to the reduction in pixel shading workloads, causing an overall improved image quality.
There are two major implementations available, called Tier 1 and Tier 2 Variable Rate Shading. Technically Software VRS and Fixed Foveated Rendering count as their own implementations, but they both use a similar screen-space implementation to Tier 2.
Tier 1 - Material Shading Rate
Tier 1 operates on a per material basis and must be defined in the Master Material in Unreal Engine. This is then passed into the draw call to specify which Shading Rate to use (eg. 1x1 is standard, 2x2, 4x4 or a non-square variation such as 2x1). Tier 1 is available since Unreal Engine 4.
Tier 1 is available on Basepass and Translucency. It does not work on Nanite Basepass.
Related CVARs
r.VRS.Enable 1
Tier 2 - Contrast Adaptive Shading
A screen-space implementation that computes an image using edge thresholds to figure out which sections on screen (using previous frame data) have a low contrast with neighboring pixels to allow a reduction in shading rate without it negatively impacting visual quality.
These sections are calculated per 8x8 or 16x16 tiles. The maximum shading rate reduction used is 2x2, even though 4x4 is supported in theory it's not used.
Related CVARs
r.VRS.Enable 1
r.VRS.EnableImage 1
(Removed in 5.5)r.VRS.ContrastAdaptiveShading 1
r.VRS.Preview (0, 1, 2)
Software VRS
Introduced in UE 5.4, currently only supporting Nanite Basepass (as of 5.5). A major benefit of Software VRS implementation is the smaller tilesizes of 2x2 which allow far more sections on screen to use a reduced shading rate compared to 8x8 or 16x16.
We can expect additional renderpasses to use this in the future, alongside supporting compute shaders for a reduced workflow rather than it only supporting pixel shaders.
Related CVARs
r.VRS.Enable 1
r.VRS.EnableSoftware 1
r.VRS.SoftwareVRS 1
(on by default)
Foveated Rendering (VR)
For VR there is Fixed Foveated Rendering which reduces the Shading Rate at the screen edges based on a static image.
Limitations
Keep in mind that certain features may prevent VRS from working properly or at all.
- DLSS, FSR, XeSS and other third-party upscaling techniques may cause artifacts.
- Film Grain prevented VRS Tier 2 from working at all due to the added noise. This was fixed in UE 5.4
- Certain Material configurations may prevent VRS from working such as Masked Materials, Custom Primitive Data and Substrate.
We'll talk more in depth on the limitations and benefits of VRS in the individual lessons for each implementation.
References
- Variable Rate Shading Tier 1 Usage Guide With Unreal Engine
- Tier 2 Variable Rate Shading in Gears 5
- Iterating on Variable Rate Shading in Gears Tactics
- Variable Rate Shading: a scalpel in a world of sledgehammers
- What Is VRS And Is It A Next-Gen Game-Changer? Digital Foundry
- Variable Rate Shading Update Xbox Series Consoles
0 comments