Moving Gears to Tier 2 VRS Variable Rate Shading

Discussion in 'Rendering Technology and APIs' started by iroboto, Jan 12, 2021.

  1. iroboto

    iroboto Daft Funk
    Legend Regular Subscriber

    Joined:
    Mar 6, 2014
    Messages:
    13,021
    Likes Received:
    15,765
    Location:
    The North
    https://devblogs.microsoft.com/directx/gears-vrs-tier2/
    much more detail in the link:
    cut and paste summary

    Moving to Tier 2
    The Xbox Series X|S launch of Gears 5/Tactics and the story DLC Hivebusters added new rendering features including contact shadows and screen space global illumination as well as an emphasis on 60FPS cinematics. While the features had great visual results, they were costly even on high-end GPUs. We investigated ways of keeping 4K and 60 FPS while also maintaining the rich detail of our PC Ultra textures and running these new visual features on both Xbox Series X|S and PC. This led us to revisit some of the VRS work done in Gears Tactics. While the use of Tier 1 VRS in Gears Tactics offered some great performance gains, it had some small compromises to visual quality and didn’t work well with Dynamic Resolution Scaling. As a result, we investigated the extra flexibility allowed in Tier 2 to see if we could solve the Tier 1 shortcomings.

    The primary difference between Tier 1 and Tier 2 VRS is granularity. Tier 1 allows you to specify a shading rate per draw. Tier 2 allows you to instead specify the shading rate in a screen space texture. The texture is not 1-1 with the render target but instead specified in coarser VRS tiles of either 8×8 or 16×16 depending on hardware. By analyzing our previous frame’s scene color, this allowed us to output a texture that would apply coarse shading rate only in sections that we’ve determined can reduce shading without causing any perceptible difference. For more details on the VRS API, refer to the VRS announcement.


    VRS Texture Generation
    We generated the VRS texture by running a sobel edge detection compute shader on our final scene color buffer. The VRS Texture is reprojected for use on the next frame as part of a rescale shader described later. The edge detection is run on the luminance of the sRGB color. The use of sRGB ensures that edges are detected based on the perceptual difference of colors. A configurable threshold value is passed to the shader that can adjust how aggressive the edge detection should be and is also the primary knob used for tuning the different VRS quality settings on PC.

    Working with Dynamic Resolution Scaling
    Gears 5/Tactics leverage Dynamic Resolution Scaling to ensure it hits a smooth 60 FPS. If we detect we’re nearly over budget, Dynamic Resolution Scaling kicks in and renders the next frame at a lower resolution to ensure a frame isn’t dropped. We also leveraged Unreal Engine’s temporal upscaling to run post processing at full resolution–even if Dynamic Resolution is downscaling, which keeps a high-quality final image. However, this causes a problem since the VRS texture generation is run at full resolution but then could potentially need to be applied at a lower resolution. To resolve this, we ran a compute shader that rescaled the VRS texture to correct for dynamic resolution. Because the VRS texture is significantly smaller than the full resolution buffer, the GPU cost of this rescale ended up being very fast (0.02ms on Xbox Series X|S).

    Variable Rate Shading and Dynamic Resolution Scaling are both powerful techniques with different strengths and weaknesses. Dynamic Resolution Scaling allows a scaling of resolution in the form of a percentage that can be dialed up and down at a pixel level to ensure the targeted frame rate is maintained while keeping the GPU fully utilized. The weakness, however, is that scaling down resolution must be done on the entire render target resulting in a global reduction of resolution. Tier 2 Variable Rate Shading is a complete flip of Dynamic resolution. Reduction in resolution is discretely controlled via the small handful of allowed shading rates, but in exchange is flexible in what parts of the render target are affected.

    We found our approach allowed us to play to the strengths of both Dynamic Resolution Scaling and Variable Rate Shading. VRS takes a first stab at applying coarse shading based on the edge detection results. Next frame, Dynamic Resolution Scaling looks at the total GPU frame time with the VRS savings being factored in and adjusts the scaling if needed. As an example, VRS applied to the real-time cinematics on the Xbox Series X allowed for dynamic resolution to run an average of 10% higher, and in the best cases, removed the need for any downscaling altogether.

     
    RagnarokFF, Krteq, iceberg187 and 5 others like this.
  2. trinibwoy

    trinibwoy Meh
    Legend

    Joined:
    Mar 17, 2004
    Messages:
    11,207
    Likes Received:
    1,779
    Location:
    New York
    Does the reprojection shader also take motion into account?
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...