WaveVR AdaptiveQuality tutorial

Contents

Introduction

To save battery and maintain the device’s rendering performance, WaveVR SDK provides an API that can adjust the CPU/GPU performance level automatically according to the CPU/GPU usage.

The behavior of AdaptiveQuality in the latest SDK version differs from previous SDK versions.

WaveVR SDK 3.1.0 to 3.1.6:

  • WaveVR SDK provide a WVR_EnableAdaptiveQuailty API that can adjust CPU/GPU performance levels automatically. It sends the event WVR_EventType_RecommendedQuality_Lower or WVR_EventType_RecommendedQuality_Higher based on system workload.
  • WaveVR AdaptiveQuality is not enabled by default.

WaveVR SDK 3.2.0 or later:

  • WaveVR AdaptiveQuality supports a set of strategies to improve the FPS when rendering quality is insufficient.
  • WaveVR AdaptiveQuality is enabled by default with WVR_QualityStrategy_SendQualityEvent strategy.

WaveVR SDK 4.0.0 or later:

  • For the developer using VIVE Wave XR Plugin, add three AQ modes(Quality mode, Performance mode and customization mode) can be selected.

Note

WVR_EnableAdaptiveQuality might not be supported on some non-HTC HMDs.

WaveVR AdaptiveQuality API

WVR_EnableAdaptiveQuality Added in API level 4
WVR_IsAdaptiveQualityEnabled Added in API level 4

WaveVR AdaptiveQuality strategy

Starting from WaveVR SDK 3.2.0, WaveVR AdaptiveQuality lets you specify what strategies to use to adjust the display quality.

Below are the supported strategies. You can specify just one strategy or combine multiple strategies:

WVR_QualityStrategy_Default
WVR_QualityStrategy_SendQualityEvent
WVR_QualityStrategy_AutoFoveation

[Strategy] WVR_QualityStrategy_Default

Adjust the CPU/GPU performance level automatically.

[Strategy] WVR_QualityStrategy_SendQualityEvent

  1. Adjust the CPU/GPU performance level automatically.
  2. Send the event WVR_EventType_RecommendedQuality_Lower or WVR_EventType_RecommendedQuality_Higher based on system workload.

Note

  • WVR_EventType_RecommendedQuality_Lower will continuously broadcast when the frame rate value dips below a certain frame rate because the rendering load is heavy.
  • WVR_EventType_RecommendedQuality_Higher will continuously broadcast when the rendering performance load isn’t too heavy.

[Strategy] WVR_QualityStrategy_AutoFoveation

  1. Adjust the CPU/GPU performance level automatically.
  2. Enable/Disable the foveated rendering level (low/medium/high) dynamically based on system workload.

WaveVR AdaptiveQuality Sample

Note

WVR_EnableAdaptiveQuality must be used after WVR_RenderInit is invoked.

Example of WVR_EnableAdaptiveQuality in the native app:

#include <wvr/wvr_system.h>

// Initiate the render runtime.
WVR_RenderInitParams_t param;
WVR_RenderError pError = WVR_RenderInit(&param);
....
....
// Enable WVR_EnableAdaptiveQuality
bool result = WVR_EnableAdaptiveQuality(true);
if (result)
    LOGI("Setting WVR_EnableAdaptiveQuality is done.");
else
    LOGE("Setting WVR_EnableAdaptiveQuality is failed");

// Disable WVR_EnableAdaptiveQuality
result = WVR_EnableAdaptiveQuality(false);

// Enable WVR_EnableAdaptiveQuality with "SendQualityEvent" strategy.
// (Supports from SDK3.2.0 or later).
result = WVR_EnableAdaptiveQuality(true, WVR_QualityStrategy_SendQualityEvent);

// Enable WVR_EnableAdaptiveQuality with "SendQualityEvent" and "AutoFoveation" strategies. (Supports from SDK3.2.0 or later).
result = WVR_EnableAdaptiveQuality(true, WVR_QualityStrategy_SendQualityEvent | WVR_QualityStrategy_AutoFoveation);

Here is an example how to receive recommended quality event in the native app:

#include <wvr/wvr_system.h>

bool handleInputSample() {
    .....
    WVR_Event_t event;
    while(WVR_PollEventQueue(&event)) {
        switch(event.common.type) {
            ...
            case WVR_EventType_RecommendedQuality_Lower:
            {
                // Handle RecommendedQuality_Lower event.
                // Developer can choose whether to handle it.
                // EX: Reduce the rendering target size gradually or disable MSAA.
                break;
            }
            case WVR_EventType_RecommendedQuality_Higher:
            {
                // Handle RecommendedQuality_Higher event.
                // Developer can choose whether to handle it.
                // EX: Recover the rendering target size or enable MSAA.
                break;
            }
            default:
                break;
        }
    }
    .....
}

Please also see the WVR_PollEventQueue .

Conclusion

  • Enabling WaveVR AdaptiveQuality can help lightweight VR apps, such as photo or video playing apps, be used longer.
  • Enabling WaveVR AdaptiveQuality with WVR_QualityStrategy_SendQualityEvent and WVR_QualityStrategy_AutoFoveation can improve the rendering quality by up to 15% if the rendering bottleneck is GPU fragment processing bound.
  • Rendering improvements by WaveVR AdaptiveQuality has limits. It is still highly recommended to tune your app first. See Optimization Tips for Mobile VR experiences .