-
Notifications
You must be signed in to change notification settings - Fork 68
Description
The Problem
The function xrEnumerateViewConfigurationViews returns the "recommended" and "max" image sizes for creating views in a XrViewConfigurationView struct, however this information is not sufficient in choosing a suitable view image size for the following reasons (suggestions for a fix below):
- recommendedImageRectWidth/Height - This tends to return a size which renders much lower than the headset's physical resolution, making renderings noticeably low detail.
- maxImageRectWidth/Height - This tends to return the maximum texture size the rendering hardware supports, which can be much higher than the headset's physical resolution, resulting in very poor performance.
Because the "recommended" size can be too low and "max" too high, these values are unsuitable for many apps and this leaves developers needing to guess as to what image size to use. This often results in a "resolution multiplier" being used, which is often arbitrarily set around 1.4 or 1.7 times the recommended size, but obviously these are magic numbers geared towards a specific device and not universal across different devices. The purpose of OpenXR is to be cross-platform and take the guesswork out of VR/XR development, and for that end, improvement is needed in this particular case.
Suggested Fix
Every app has different requirements: some have complex rendering which needs a lower resolution to maintain frame rate, others are simpler and can afford to render a sharper image. So what we need is a range of recommended values to cover all use cases, rather than just one.
My suggestion is to replace the "recommended" size values in XrViewConfigurationView with "recommended for performance" and "recommended for quality" sizes. Having this range allows developers to choose a value within that range which best suits their app without having to guess at the headset's actual resolution.
Currently the width values are:
typedef struct XrViewConfigurationView {
...
uint32_t recommendedImageRectWidth;
uint32_t maxImageRectWidth;
...
} XrViewConfigurationView;
The new structure would be:
typedef struct XrViewConfigurationView {
...
uint32_t recommendedPerformanceImageRectWidth;
uint32_t recommendedQualityImageRectWidth;
uint32_t maxImageRectWidth;
...
} XrViewConfigurationView;
Likewise for the height values.
The specification would inform the developers that any size within this range would be suitable for the view sizes, and not restricted to these specific values.