Fri. Feb 3rd, 2023
That green box in the middle of this Aperture Science scene indicates that it's running right in the middle of the adaptive performance curve.

That green box in the middle of this Aperture Science scene indicates that it’s running right in the middle of the adaptive performance curve.

Officially, Valve’s SteamVR performance test appears to require a powerful Nvidia GTX 970 graphics card or better for high-end “VR-ready” performance. However, at a GDC talk last week, Valve Graphics programmer Alex Vlachos explained how some adaptive programming tricks allowed him to reasonably run Valve’s impressive Aperture Science VR demo on a four-year-old Nvidia GTX 680.

That’s especially impressive as VR graphics can often push even high-end graphics cards to their limits. In virtual reality, the graphics hardware has to push two separate displays (one for each eye) at a rock-solid 90 frames per second to avoid a nauseating lag between head movement and the on-screen display. That leaves the graphics card with just 11.1ms per frame to render complex 3D scenes.

The VR environment also means that the user can often move the first-person “camera” (i.e. his head) wherever he wants, as fast as he wants. Unlike a standard first-person engine, which usually only renders the world at a standing or crouching height, a free-roaming VR engine may need to be ready to render any object from any distance and angle, making it quick to a convincing level is displayed. detail. And a VR engine can’t just slow down when scenes get busy or complicated either. Remember, below 90fps can literally be nauseating.

In the past, VR engines have addressed this problem using tricks such as reprojection. If a complex scene meant a frame didn’t finish in time, the engine could perform a quick transformation on the previous frame, reprojecting the old image to estimate what the scene might look like with a new head position and angle. That gives the engine some time to catch up, but it’s an imperfect solution that can lead to shaky images that appear out of focus (especially if the trick is used frequently). Vlachos urged developers to use this only as “a last resort safety net” and not to rely on that technique unless the game runs on hardware well below minimum specs.

You have to learn to adapt

Moving this scale up and down automatically as needed allows a VR engine to maximize GPU usage while maintaining a solid 90 frames per second.
Enlarge / By moving this scale up and down automatically as needed, a VR engine can maximize GPU usage while maintaining a solid 90 frames per second.

A better solution, as Vlachos detailed in his GDC talk, is adaptive quality adjustment. This essentially means that the system monitors the processing time for each rendered frame and instantly lowers or raises the quality of the rendering based on how much headroom is available for that scene.

For example, if the user is looking at a relatively plain and detail-free wall, the engine can temporarily crank up the image quality to take advantage of all the extra processing time available. However, looking at the complicated innards of an Aperture robot, the engine would have to dial back quality quickly to maintain that 90 frames per second. The goal is to use 70 to 90 percent of GPU power at all times, while always pushing frames in that tight 11.1ms window (although Vlachos says working within 10ms is better to use up some GPU resources for the rest of the system).

Certain graphics functions cannot really be changed comfortably with this adaptive method; the user would probably notice if specular reflections or shadows suddenly turned on and off as they moved in VR. But the engine can easily scale up and down its display resolution and viewport size slowly without any jarring effects. The level of detail in edge-smoothing features such as multisample anti-aliasing (MSAA) can also be adjusted with relative ease.

Graphical explanation of two methods that can improve processing time for VR scenes.
Enlarge / Graphical explanation of two methods that can improve processing time for VR scenes.

At the extreme edges of the performance curve, the engine can even pull off some VR-specific graphics tricks to ensure rendered frames are ready on time. For example, by using fixed foveated rendering, the engine can lower the apparent resolution in a ring around the edge of each eye’s circular VR view. Radial density masking similarly skips displaying alternating pixels near the edge of the player’s view and instead fills them in based on their neighbors. These tricks save a lot of processing time — enough for a 10 to 25 percent performance boost on their own, Vlachos said — while also reflecting our eyes’ natural tendency to see objects in greater detail near the center of our vision.

Lower the VR bar

With all this in mind, Vlachos was able to set some cascading quality levels for Valve’s Aperture Science demo. On the high end (reliably only achievable on a premium GTX 980Ti card), the demo can run at 140 percent native resolution and at enhanced 8x MSAA. On the low end, the resolution drops to 65 percent of default, MSAA scales back to 4x, and Radial Density Masking is enabled.

These changes allow a demo originally designed for a GTX 970 to run at a consistent frame rate on a four-year-old GTX 680 (even if details like text are hard to read at the heavily reduced resolutions required). While that doesn’t mean Vlachos is comfortable recommending old hardware as the new “minimum spec” for SteamVR, providing room for such a heavy test gives artists more leeway to weigh the trade-offs between highly detailed in-game objects and lower view. resolutions. It also automatically improves how good VR games can look on high-end hardware without having to spend time writing new shader code or drawing new art assets.

Instead of hoarding this adaptive quality scaling for its own Source 2 engine, Valve will make it available as a free Unity Engine rendering plugin in the coming weeks. The hope is that the indie studios making many of the early VR games will be able to instantly make those games look better and perform better without a lot of extra work. Technical details aside, it’s nice to see Valve doing this kind of low-key work to ensure that virtual reality games perform as well as they can right out of the box.

By akfire1

Leave a Reply

Your email address will not be published.