您的位置:首页 > 其它

VR系列——Oculus Rift 开发者指南:四、高级渲染配置(三)

2017-06-12 22:28 489 查看

通过减少像素密度提高性能

DK1拥有1280x800像素的分辨率,其在两眼之间划分。然而,由于Rift的宽FOV和透视投影工作的方式,位于显示器中心的匹配原始分辨率的中间渲染目标所需的大小会显著更大一些。

例如,要在DK1上实现将一个1:1的像素映射在作者视场的中心,需要一个大得多的达到2000 x1056像素大小的渲染目标。

即使现在的显卡可以在规定的60Hz渲染这个分辨率,但未来的HMD可能拥有更高的分辨率。对于虚拟现实,下降到60Hz以下的话将会导致非常糟糕的用户体验,最好是降低分辨率来维持帧率。这类似于一个用户拥有一个分辨率高达2560 x1600的显示器。极少数的3D应用程序可以在这种原始分辨率下全速运行,所以大部分应用允许用户选择一个较低的分辨率,这样显示器能够提升整个屏幕的频率。

你可以在HMD中使用相同的策略。也就是说,在较低的视频分辨率下运行它,并让硬件提升频率。然而,这引入了两个过滤的步骤:一个是失真处理,一个是视频升频。不幸的是,这种双重过滤引入了重要的工件。通常在原始分辨率下放弃视频模式是更有效的,但这限制了中间渲染目标的大小。这类似于性能的提高,但它保留了更多细节。

解决此问题的一个方法是允许用户通过一个分辨率选择器来调整分辨率。然而,渲染目标的实际分辨率取决于用户的配置,而不是一个标准的硬件设置。这意味着“原始”的分辨率对不同的人的而言是不一样的。此外,呈现比物理硬件分辨率更高的分辨率可能会使一些用户感到困惑。他们可能不明白为什么选择了1280x800的分辨率但画面质量却显著下降,即使这是由硬件所上报的分辨率。

一个更好的选择是修改传递给ovr_GetFovTextureSize函数的pixelsPerDisplayPixel值。这也可以基于在应用程序渲染呈现的一个滑块设置。这决定了渲染目标像素映射到像素的中心显示面的相对大小。例如,值为0.5会使渲染目标的尺寸从2000x1056缩小到1000x528像素,这可能会使中档的PC显卡保持在60Hz。

float pixelsPerDisplayPixel = GetPixelsPerDisplayFromApplicationSettings();
Sizei recommenedTexSize = ovr_GetFovTextureSize(session, ovrEye_Left, fovLeft, pixelsPerDisplayPixel);


尽管你可以将参数设置为大于1.0的值,以产生具有更高分辨率的中间渲染目标,但Oculus公司目前为止还没有观察到任何有效的质量提升,并且这会导致高性能成本。

OculusWorldDemo允许你尝试改变渲染目标像素密度。导航到设置菜单(按Tab键),然后选择像素密度(Pixel Density),按上下方向键调整像素在眼睛的中心的投影密度。值为1.0时,渲染目标像素密度以1:1显示在显示面.值为0.5时,渲染目标像素密度为显示面的一半。此外,你还可以选择动态分辨率(Dynamic Res Scaling),这样能使像素密度自动在0到1之间进行调整。

原文如下

Improving Performance by Decreasing Pixel Density

The DK1 has a resolution of 1280x800 pixels, split between the two eyes. However, because of the wide FOV of the Rift and the way perspective projection works, the size of the intermediate render target required to match the native resolution in the center of the display is significantly higher.

For example, to achieve a 1:1 pixel mapping in the center of the screen for the author’s field-of-view settings on a DK1 requires a much larger render target that is 2000x1056 pixels in size.

Even if modern graphics cards can render this resolution at the required 60Hz, future HMDs might have significantly higher resolutions. For virtual reality, dropping below 60Hz provides a terrible user experience; it is always better to decrease the resolution to maintain framerate. This is similar to a user having a high resolution 2560x1600 monitor. Very few 3D applications can run at this native resolution at full speed, so most allow the user to select a lower resolution to which the monitor upscales to the fill the screen.

You can use the same strategy on the HMD. That is, run it at a lower video resolution and let the hardware upscale for you. However, this introduces two steps of filtering: one by the distortion processing and one by the video upscaler. Unfortunately, this double filtering introduces significant artifacts. It is usually more effective to leave the video mode at the native resolution, but limit the size of the intermediate render target. This gives a similar increase in performance, but preserves more detail.

One way to resolve this is to allow the user to adjust the resolution through a resolution selector. However, the actual resolution of the render target depends on the user’s configuration, rather than a standard hardware setting This means that the ‘native’ resolution is different for different people. Additionally, presenting resolutions higher than the physical hardware resolution might confuse some users. They might not understand that selecting 1280x800 is a significant drop in quality, even though this is the resolution reported by the hardware.

A better option is to modify the pixelsPerDisplayPixel value that is passed to the ovr_GetFovTextureSize function. This could also be based on a slider presented in the applications render settings. This determines the relative size of render target pixels as they map to pixels at the center of the display surface. For example, a value of 0.5 would reduce the render target size from 2000x1056 to 1000x528 pixels, which might allow mid-range PC graphics cards to maintain 60Hz.

float pixelsPerDisplayPixel = GetPixelsPerDisplayFromApplicationSettings();
Sizei recommenedTexSize = ovr_GetFovTextureSize(session, ovrEye_Left, fovLeft, pixelsPerDisplayPixel);


Although you can set the parameter to a value larger than 1.0 to produce a higher-resolution intermediate render target, Oculus hasn’t observed any useful increase in quality and it has a high performance cost.

OculusWorldDemo allows you to experiment with changing the render target pixel density. Navigate to the settings menu (press the Tab key) and select Pixel Density. Press the up and down arrow keys to adjust the pixel density at the center of the eye projection. A value of 1.0 sets the render target pixel density to the display surface 1:1 at this point on the display. A value of 0.5 means sets the density of the render target pixels to half of the display surface. Additionally, you can select Dynamic Res Scaling which will cause the pixel density to automatically adjust between 0 to 1.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐