VRS enables Gears Tactics to achieve significant performance gains - up to 18.9%! - on a wide range of equipment without noticeable loss of image quality.
One of the main goals when developing Gears Tacticswas to reach a wider PC audience by lowering the minimum system requirements. To do this, it was necessary to find new solutions to improve performance, which would not require significant reduction in graphics quality. One of these solutions was VRS.
In this article, we'll take a closer look at the process of tuning VRS to achieve the optimal balance between quality and performance. In particular, on which rendering passes to use it and with what parameters.
Since the main goal was to include the widest range of equipment in the implementation, we will only talk about the first level of VRS support (Tier 1), which allows you to set the shading rate for each object. For more information on VRS, you can read this post .
In the case of Gears Tactics, VRS does not apply to support levels higher than the first, so it was necessary to determine on which rendering passes to use it (note that Gears Tacticscreated on Unreal Engine 4), as well as formulate criteria for when the shading rate should be reduced - the size of the pixel area to which one-time rendering is applied. The higher it is (the highest is 1 × 1), the higher the rendering accuracy and, accordingly, the higher the load on the GPU.
As it turns out, VRS can be beneficial at any stage of rendering, including some full-screen renders.
Rendering pipeline evaluation
At first it seemed that the base render pass and the translucency pass should represent the most optimization potential compared to the others. Therefore, VRS was enabled for all draw calls in the base pass and in the translucency pass, but the latter had too severe artifacts.
So, the next step was to evaluate which passes are the most promising for getting the maximum benefit from VRS, and then test the shading rate on these passes and exclude those that left artifacts. Thus, passes using accurate pixel information were found to be one of the main causes of these artifacts.
To find out which passes were the most effective, it was necessary to turn on the VRS on all of them, and then narrow them down in the PIX to those that performed better than others.
Here they are:
- Composition after lighting: Lighting for subsurface scattering materials.
- Filter Translucent Volumes: Smooths translucent meshes within the volume to avoid blending problems.
- Light attenuation: The light attenuation is the outer bounds when calculating the decay of a given lighting. This pass is repeated for shaded lights, taking into account the calculated falloff, to render shadow projections.
- (Light composition tasks (PreLighting)): .
- (Light Shaft Bloom): (), .
- (Screen Space Reflections): .
- - (SSR Temporal AA): .
- (Direct Deferred Lighting): .
Then it was necessary to assess the severity of the artifacts received in these passages due to VRS. The process turned out to be quite time consuming as Gears Tactics has several biomes with different types of weather conditions. You could get good results in the city during the day, but the artifacts would come out in the sandy environment, or foliage, or at night in the rain.
The following passes showed performance improvements with VRS enabled, but had too many artifacts to be worth using:
- Translucent lighting (Translucency);
- Deferred Lighting;
- Composition after lighting.
Example showing an image before and after Composition after lighting with a coarse 4x4 pixel size
After eliminating these passes, work began to adjust the shading rate based on other factors. First of all, dynamic objects and objects with a transparency mask were excluded.
Dynamic objects cast a fully dynamic shadow. Because of this, with VRS, they often lose important details and become more visible throughout the scene, as well as during movement. Applying VRS to a transparency mask also resulted in a large loss of detail. And since objects with a pixel depth offset also turned out to be displayed incorrectly, they were also excluded.
VRS was used on a set of masked objects resulting in an unacceptable loss of detail
Dynamic techniques
So we've put together a nice set of render passes to which you can apply VRS. However, the widespread use of the smallest shading rate (4 × 4 or 2 × 2 depending on hardware support) on these passes will lead to a significant loss of quality. Therefore, the next step was to study dynamic methods that could change the shading rate depending on a specific pass. As a result, three of them were formed. Each of them was used in key passes just before drawing the mesh.
These methods are: object sizing, depth-of-field masking, and fog of war masking.
Determining the size of an object
In this method, VRS is actively applied on any grid that is extremely small compared to the playing space. It is based on a quick check of the condition, whether the value of the size of an individual polygon in the mesh is below a specified threshold. If so, the shading rate is scaled proportionally to this size.
Depth of field masking
For most GPUs, Depth of Field in Gears Tactics is turned off by default, but turned on during cutscenes. This method determines how much the mesh is blurred after applying the depth of field in post-processing. And, since at this stage the details are deliberately eliminated, a small shading rate can be set on all previous key passes.
Meshes highlighted in red have the coarsest pixel size due to depth of field
Fog of War disguise
Gears Tactics uses Fog of War to hide parts of the battlefield. It can also be used to mask the lowered shading rate. This technique determines how far a particular polygon mesh is hidden by the "fog of war" and, based on this, reduces the shading rate proportionally.
VRS intensity grows in proportion to the fog of war intensity
Quality to performance ratio
It turned out that using the combination of the methods described above, you can get more than 30% performance gain due to a significant reduction in the shading rate. True, the loss of quality will be more noticeable than we would like. Therefore, the next step was to manually adjust the shading rate for each pass through several biomes and evaluate the performance gain and image quality after each change.
As a result, VRS received two levels. The “On” configuration has the least impact on image quality, provided you disable VRS for some render passes and limit the shading rate drop. At the same time, the "Performance" setting will result in small compromises in image quality in favor of increasing performance using lower shading rates.
There is another advantage of using shading rate, which requires additional power. Pixel sizes larger than 2 require additional hardware shading rate support, so any pass using a 2x4, 4x2, or 4x4 shading rate is limited to the "Performance" level.
Test results
Testing conducted with Intel Gen 11 and Intel Xe and NVIDIA Turing. All supported tools have similar performance gains.
Equipment under test
Operating system: Windows 10 Pro 64-bit (10.0, Build 18362) (18362.19h1_release.190318-1202)
Processor: Intel® Core (TM) i9-9900X CPU @ 3.50GHz (20 CPUs), ~ 3.5GHz
Memory: 98304 MB RAM
Video card: NVIDIA GeForce RTX 2080 SUPER
All tests were carried out at Ultra game settings with 4K resolution
All techniques at “VRS On” settings All techniques enabled
at “VRS Performance”
VRS extension
Additional benefits can be gained by extending the VRS applications described here.
Further masking techniques
Additional masking techniques can improve VRS performance or reduce artifacts. These methods can vary depending on cases where areas are shaded or blurred during play:
- Motion Blur : Cameras using fast moving scenes can easily use VRS on most meshes with motion blur enabled.
- Particles: Polygon meshes hidden behind a thick layer of particles can be used to mask high intensity VRS.
Dynamic VRS
As with dynamic resolution scaling, a possible improvement is to scale the VRS based on frame rate to minimize the time it takes to use it. This is a separate tracking system that may require adjustment at different frequencies to avoid amplifying artifacts.
Dynamic Resolution Scaling (DRS)
Gears Tactics uses both VRS and DRS for optimization, but these features may not have very good compatibility. This is because when DRS changes the resolution scale, VRS artifacts also change. This leads to the fact that the player either learns about the VRS artifacts and the resolution change at once, or both go unnoticed. One way to use both functions at the same time would be to monitor the DRS rate of change and disable the use of VRS until it stabilizes.
Instead of a conclusion
Skillful use of Tier 1 VRS can achieve significant performance gains on a wide range of equipment with minimal impact on image quality.