sensics / OSVR-RenderManager

Apache License 2.0
64 stars 45 forks source link

display rotation configuration does not work on dual-screen displays #260

Closed gfrolov closed 7 years ago

gfrolov commented 7 years ago

When testing DirectMode on dual-screen display setup that receives portrait video, I wasn't able to rotate the displays to show landscape picture. I modified "rotation" setting to "90" and "270" with no visible effect "display": { "rotation": 0, "bitsPerColor": 8 },

CC @russell-taylor

russell-taylor commented 7 years ago

With the attached config file, I was able to render to two displays using the D3D spinning-cube demo. When I switched rotation from 0 to 90, the windows changed their aspect ratios and the images rotated by 90 degrees (cubes spinning up rather than left). When I changed to 270, the images flipped and the cubes spun down. This is behaving as expected.

nondirectmode_dual_window.zip

russell-taylor commented 7 years ago

I'll try to reproduce this on a pair of DirectMode displays, rather than using the two on-screen displays, but these both follow the same rendering path as far as image orientation is concerned.

russell-taylor commented 7 years ago

The trick is that when you rotate the display with the "rotation" parameter above, you also need to swap the requested display resolution, because the rendering happens in the un-rotated display resolution and then RenderManager rotates it (swapping aspect ratio) when rendering. If the viewer will see a landscape image (1920x1080) but the display scans out in portrait (1080x1920), you set the display resolution to 1920x1080 and then rotate by 90 (or 270).