What is Variable Rate Shading (VRS)

Variable Rate Shading (VRS) will represent one of the key technologies of video games in the coming years. Supported by new consoles such as Playstation 5 and Xbox Series X, but also by desktop GPUs from Nvidia, AMD and Intel, it will allow for greater performance without losing visible graphics quality. In this article we explain what it is.

Variable Rate Shading is a term that will enter the lexicon of gamers in the coming months. We first heard this from Nvidia, at the presentation of the Turing GPU-based video cards, and later from Microsoft, which first implemented the technology in the DirectX 12 API on PC and later announced Xbox Series X support. .

“Our patented form of VRS allows developers to use the full power of the Xbox Series X more efficiently. Rather than spending GPU compute cycles for every single pixel on the screen, developers can prioritize individual effects on a character’s characters. game or important environmental objects . This technique leads to more stable frame rates and higher resolution, without impacting the final image quality. ”

AMD has subsequently confirmed full support for Variable Rate Shading (VRS) with the RDNA 2 graphics architecture , which will be the basis of the company’s future GPUs arriving by the end of the year and of the new consoles from Microsoft and Sony. The technical explanation given by Microsoft regarding Xbox Series X is still “rose water”, but on the occasion of the implementation in DirectX 12 the Redmond house was certainly more detailed. So let ‘s explain what this Variable Rate Shading is and how it can change the lives of developers and players.

Variable Rate Shading explained easily

Variable Rate Shading is a new API that allows developers to use GPUs more intelligently . Developers can allocate the power of the GPU to specific areas of the game image , such as certain characters, a vehicle and the track on which it moves or otherwise, and less on other areas that can be defined as “secondary”.

Click to enlarge

The rest of the image out of focus of the gamer can be reproduced with a slightly lower graphics level , thus allowing the GPUs to reach higher FPS, frame rates per second. We must not forget that in fact that on a game screen only a fraction of the areas require maximum detail, while the others can also lose some “nuance” that is not important for the overall quality, but important for gaining performance.

Take, for example, a car racing game: it is necessary to reproduce the cars and the road in maximum graphic detail, but at the same time it is not important if the audience in the stands is slightly less defined. On the other hand, the cars move quickly and the attention of our eyes is on other aspects. The visual impact for the gamer is consequently zero or almost zero, but the performance improves significantly.

Variable Rate Shading explained in a difficult way

For many, the article might end here, but let’s move on to a slightly more technical explanation. On the other hand, the Variable Rate Shading ( also known as coarse pixel shading ) is the union of very precise terms, and the translation is “variable rate shading”. Shading means “shading” , and it is an operation at the base of computer graphics that describes how surfaces (polygonal meshes) respond to light according to their characteristics, the angle of impact of the light, of vision of the observer and other aspects. In short, shading defines the appropriate levels of light, darkness and color in an image rendered by your GPU.

This is where the term ” rate ” comes into play , ie rate or speed. In conjunction with ” variable “, VRS describes a variable shading rate , which is the resolution at which shaders are “called”, not to be confused with screen resolution. A shader is a set of algorithms that perform the shading operation during the rendering process.

For each pixel on the screen, the shaders are called upon to calculate what a pixel’s color should look like. The higher the shading rate, the higher the visual fidelity, but also the impact on compute performance , which the GPU takes care of. A lower shading rate means the opposite, which is lower visual fidelity and lower performance impact.

Traditionally, the shading speed set by developers for a game is applied across all pixels of an image. The problem, if we want to define it that way, is that “not all pixels are the same”. With VRS, developers have the ability to selectively reduce the shading rate in image areas that do not affect visual quality, thus gaining performance. In this way, not only can a GPU reach higher speeds, for example 90 instead of 65 fps, but at the same time even lower-end (less powerful) hardware is able to run a game faster than the same title without VRS support. .

Illustrating the integration into the DirectX 12 API , Microsoft talked about three different ways to set the shading rate : “per draw”, “within-draw using a screenspace image” and “within a draw , by primitive “. A “draw” is nothing more than the operation of drawing objects on the screen. A screenspace image is the coordinate space of the resulting 2D image during 3D rendering, which is the result of 3D projection onto geometry in camera space. The primitive, on the other hand, represents the simplest geometric object that a system can manage.

There are also two versions, called Tier, to identify the different types of hardware and support for the Rade Shading Variable (VRS). The hardware that can support the VRS per draw in hardware is referred to as Tier 1. The Tier 2 is the hardware compatible also with the VRS per-draw and within-draw.

Tier 1 implementation. One party has VRS, the other does not: which one? The difference is imperceptible – Click to enlarge

By allowing developers to set the shading rate per draw, different draw calls – calls that are made to the graphics API (Direct3D in this case) in order to render objects – can have different shading rates. This allows a developer to create large environmental assets or other elements with a lower shading rate, while maintaining a higher shading rate for more detailed assets in a scene.

As written earlier, Tier 2 hardware gives developers additional flexibility. “By allowing developers to indicate the shading rate using a screenspace image, it opens up the possibilities for a variety of techniques. For example,” Microsoft explains, ” foveated rendering renders much of the detail in the area where the user places. attention and gradually reduce the shading rate out of that area to improve performance. In an FPS, the user probably pays a lot of attention to the viewfinder and little to the extreme edges of the screen, which makes FPS an ideal candidate for this technique. “.

The shading rate per primitive means that developers can indicate, within a draw, the shading rate per triangle. This technique can be applied by developers who know they will apply depth of field blur to render triangles beyond a certain distance with a lower shading rate. This will not lead to a reduction in visual quality but to an increase in performance, as faraway triangles will still be blurry.

Tier 2 implementation. The left side is the one with VRS active – Click to enlarge

Developers don’t have to choose between these techniques, as Microsoft allows them to be combined at the same time. Microsoft illustrated the impact of VRS on games by partnering with Firaxis and leveraging existing Nvidia hardware. The software house has added both draw and screenspace image support to Civilization.

Before implementing VRS , the system with a GeForce RTX 2060 at 4K achieved a frame rate of around 53 fps . By adding Tier 1 support, reproducing land and water with a lower shading rate and other smaller assets such as vehicles, UI and buildings with a higher shading rate, performance has grown by 20% with almost no degradation in quality .

Red indicates areas where the shading rate is set to 1×1 (more shading, more detail), blue ones where it is 2×2 (less shading, less detail)

With Tier 2, Firaxis has implemented the screenspace image greatly reducing the negative impact on image quality and recording a 14% increase in FPS. VRS will be supported not only by Nvidia and AMD but also by Intel. The company has already shown a first test with the Gen11 integrated graphics hardware and a demo called Sun Temple made with the Unreal Engine 4, so let’s also expect support on the new X architecture and future dedicated video cards.

As for game engines and titles, companies such as Ubisoft, Activision, Epic Games, 343 Industries, Unity, Playground Games, Massive Entertainment and Turn10 have already been working for months on VRS, which will therefore become, thanks to the new consoles, a feature almost standard of games for the next few years.

VRS in Nvidia sauce? Nvidia Adaptive Shading (NAS)

Nvidia was the first with Turing GPUs to implement Variable Rate Shading in the form of Nvidia Adaptive Shading (NAS) , using two algorithms called Content Adaptive Shading (CAS) and Motion Adaptive Shading (MAS) . In the first case the shading rate is related to the spatial and temporal coherence of the colors between the frames, in the second to the amount of movement present in a particular part of the scene.

NAS was implemented in Wolfenstein: Youngblood with three quality settings called Quality, Balanced and Performance, with each having different trade-offs in terms of quality and performance. Using Balanced or Quality the qualitative decrease is limited, which instead becomes slightly more aggressive in Performance, even if it is visible to a trained eye and mainly when comparing static images. NAS, according to Nvidia, can speed up MachineGames game performance by up to 15%.

Content Adaptive Shading predicts the impact of shading at reduced speed and does so only if the impact is expected to be subtle. Thanks to the VRS function on the Turing GPUs, the shading rate can be set to vary independently for each 16×16 square on the screen (think of the screen as a checkerboard), allowing for careful distribution of shading over the tens of thousands of tiles that make up. the screen. In general, the less contrast and variation of objects there is in a scene, the lower the rate of shading that can be done without reducing the visual quality.

The Motion Adaptive Shading takes advantage of motion blur style effects to reduce the rate of shading when you move and turns into a game. Nvidia explained that the Motion Adaptive Shading is inspired by a phenomenon called “LCD persistence blur” related to monitors.Until recently, all screens could only be updated at fixed intervals (fixed refresh rate), so objects were displayed with jerky (albeit fast and generally inaudible) movements. At the same time, our eyes tried to follow the object in a linear motion and on our retina the image “trembled” rapidly, leading us to perceive a blurred image. In addition to screen blur, several game engines added motion blur to the rendering, thus doubling the blur effect.

LCD persistence blur and motion blur hid image imperfections related to a reduction in the shading rate. The blur did not conceal all levels of image imperfection in a similar way, however, scaling the loss proportionally. Using signal processing theories and running simulations to ensure that the best scaling factors are applied at each motion speed, Nvidia is able to MAS reduce the shading rate of the game’s blurry elements without the eyes noticing any difference. thus ensuring better performance.

 

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment