VRWorks - Variable Rate Shading (VRS)
Variable Rate Shading is a new, easy to implement rendering technique enabled by Turing GPUs. It increases rendering performance and quality by applying varying amount of processing power to different areas of the image. VRS works by varying the number of pixels that can be processed by a single pixel shader operation. Single pixel shading operations can now be applied to a block of pixels, allowing applications to effectively vary the shading rate in different areas of the screen. Variable Rate Shading can be used to render more efficiently in VR by rendering to a surface that closely approximates the lens corrected image that is output to the headset display. This avoids rendering many pixels that would otherwise be discarded before the image is output to the VR headset.
|Hardware:||Compatible with: Turing based GPUs. (GeForce RTX and Quadro RTX)|
|Software:||Compatible with the following APIs:
DX11, DX12, OpenGL, Vulkan.
Integration with Unreal Engine and Unity are coming soon
- Variable Rate Shading is a new rendering technique enabled by Turing GPUs. It increases rendering performance by applying full GPU shading horsepower to detailed areas of the scene, and less GPU horsepower to less detailed areas.
- Variable Rate Shading works by varying the number of pixels that can be processed by a single pixel shader operation. Single pixel shading operations can now be applied to a block of pixels, allowing applications to effectively vary the shading rate in different areas of the screen.
- Variable Rate Shading can be used to render more efficiently in VR by rendering to a surface that more closely approximates the lens corrected image that is output to the headset display. This avoids rendering many pixels that would be discarded before the image is output to the VR headset.
- Coupled with eye tracking, Variable Rate Shading can be applied to maximize quality in the foveated area where the eye is directly looking and reduce the shading rate in the periphery. This method can improve rendering performance without noticeably impacting image quality.
An important property of VR systems is that the optics in the lens system has a varied resolution and sample rate of the view surface. With the Maxwell and Pascal architectures, we introduced techniques such as Multi-Resolution Shading (MRS) and Lens-Matched Shading (LMS) to optimize shading workloads for VR. MRS and LMS allowed developers to split the rendering surface up into subregions and match the sampling rate to the lens in each region, rather than overshading everywhere to meet the maximum local sampling needs.
Turing introduces a new and more flexible technique to control shading rate called Variable Rate Shading (VRS). With VRS, shading rate can now be adjusted dynamically at a finer level - every 16 pixel x 16 pixel region of the screen can now have a different shading rate.
This fine level of control enables developers to deploy new algorithms that were not previously possible for optimizing shading rate and increasing performance. In this section we will describe the underlying hardware mechanisms of VRS, and a few of the powerful new algorithms that it enables.
Without VRS, every pixel in the scene in Figure 02 above would be shaded individually (the 1x1 blue grid case). With VRS, the pixel shading rate of triangles can vary. The developer has up to seven options to choose from for each 16x16 pixel region, including having one shading result be used to color four pixels (2x2), or 16 pixels (4x4), or non-square footprints like 1x2 or 2x4. The colored overlay on the right side of Figure 01 shows a possible application to a frame - perhaps the car, sky and foliage could be shaded at full rate (i.e., blue region) to preserve fine details. The area next to the car could be shaded once per four pixels (green), and the road to the far left and right periphery could be shaded once per eight pixels (yellow).
Overall, with Turing’s Variable Rate Shading technology, a scene can be shaded with a mixture of rates varying between once per visibility sample (super-sampling) and once per sixteen visibility samples. The developer can specify shading rate spatially (via a texture). As a result, a single triangle can be shaded using multiple rates, providing the developer with fine-grained control.
Note that VRS allows the developer to control the shading rate without changing the visibility rate. The ability to decouple shading rate and visibility rate makes VRS more broadly applicable than techniques such as MRS and LMS, that lower total rendering resolution in specified regions. At the same time, VRS, MRS and LMS can be used in combination since they are independent techniques enabled by separate hardware paths.
The initially released low-level VRS APIs provide expanded functionality on DX11, DX12, OGL and Vulkan. VRS can be leveraged for many uses cases like applying supersampling to text and, enhancing quality on certain materials or scene regions but one particularly beneficial use case for VR is foveated rendering. To simplify integration we developed a streamlined set of APIs that address this specific use case.
The VRS Wrapper APIs assists developers in integrating foveated rendering within their DX11 application. This implementation provides the minimum number of APIs required for integration with much of the heavy lifting done inside the NVIDIA driver. This solution includes convinient presets for performance, quality, and custom configuration.
VRS Wrapper consists of the following two interfaces and easy to use presets:
- VRS Helper controls the foveated rendering parameters
- Gaze Handler gathers and manages the eye-tracking data
Lear more about VRS Wrapper in our DevBlog Easy VRS Integration with Eye Tracking