Forum Discussion
DoZo1971
11 years agoExplorer
Direct mode workings
Hi,
If (when?) OpenGL "direct mode" will be supported how would that actually work?
I have a user-interface with an OpenGL canvas in it. I can scale the whole window so in principle the canvas could have any dimension. Of course, in the end, the OpenGL canvas is "just" another window so I should be able to pass it to ovrHmd_AttachToWindow(...).
But what about the dimensions? Would it be possible to have a fullscreen OpenGL window (1920x1080) on the Rift while at the same time maintaining the functionality of the user-interface with its arbitrary sizing visible on the desktop?
Thanks,
Daniel Dekkers
If (when?) OpenGL "direct mode" will be supported how would that actually work?
I have a user-interface with an OpenGL canvas in it. I can scale the whole window so in principle the canvas could have any dimension. Of course, in the end, the OpenGL canvas is "just" another window so I should be able to pass it to ovrHmd_AttachToWindow(...).
But what about the dimensions? Would it be possible to have a fullscreen OpenGL window (1920x1080) on the Rift while at the same time maintaining the functionality of the user-interface with its arbitrary sizing visible on the desktop?
Thanks,
Daniel Dekkers
3 Replies
- That's how it currently works in DirectX 11. You can have the on screen window a different resolution to the swap chain that is sent to the rift. For example, I've run a 192x108 window that was 1920x1080 on the rift. The actual rendering was still 1920x1080, it was just displayed in a 192x108 window. If you don't set up the window in the right way though, you will end up with 192x108 upscaled to 1920x1080 instead, which looks beyond horrible. :)
So if OpenGL direct mode works the same way, then you should be able to have full rift resolution on the rift and a lower res panel in an application (as long as you are rendering at the rift res and downscaling for the window). - DoZo1971ExplorerOk, that sounds good.
In the demos (Tuscany) from Oculus they have fixated the size of the window on the desktop.
But you managed to make these windows sizable (without interfering with the fullscreen version on the Rift)?
Thanks, Daniel "DoZo1971" wrote:
But you managed to make these windows sizable (without interfering with the fullscreen version on the Rift)?
Yep. I don't know if GL can do the same thing but it seems to work in DirectX 11 (I tried DX9, but direct mode seems broken in that too, at least with Ogre which I'm using).
Have a look in the tiny room demo source at line 235 of Win32_OculusRoomTiny_Util.cpp:RECT winSize = { 0, 0, vp.w / sizeDivisor, vp.h / sizeDivisor};
AdjustWindowRect(&winSize, wsStyle, false);
hWnd = CreateWindowA("OVRAppWindow", "OculusRoomTiny",
wsStyle |WS_VISIBLE,
vp.x, vp.y,
winSize.right-winSize.left, winSize.bottom-winSize.top,
NULL, NULL, hInstance, NULL);
The vp contains the rift resolution (1920x1080 or 1280x800).
sizeDivisor is set to 1 for full screen mode and 2 for windowed. So when you switch to windowed, the window is created at half the resolution of the rift.
Later in that function it calls RenderDevice::CreateDevice with the original resolution settings. This creates the swap chain that is used to actually render the scene.
By default ogre always forces the window to have identical res to the swap chain. But I hacked the code to do the same as the rift demo. That let me have a small res window that shows an automatic downscale of the scene, while the rift gets the full res version.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 2 years ago
- 6 months ago
- 9 months ago