Hey peeps,
I want to discuss something with you today.
As some of you might know the Preview Window of the Vive (the window you have on your PC while playing a VR game on the Vive) shows a part of the left eye.
Currently “WindowMirrorMode 1” gives us a vertical image. Based on information from the forum I created a PullRequest to at least give us a horizontal resolution. But this is still not really optimal.
The Vive has a resolution of 2160x1200. Means one eye is 1080x1200. The SteamVRRenderer maps the left eye to a range of 0 to 0.5 (horizontal) and and the right one to a range of 0.5 to 1 (also horizontal).
Both are mapped to 0 to 1 vertically. It also applies a black texture to it to surround the eyes (why ever…).
This results in the image which was posted on the forums. I can’t find the Thread/Author at this moment, so who ever did that, thanks again!
[spoiler]
&d=1469637397[/spoiler]
The blue rectangle is the current “WindowMirrorMode”. The green one is the one the PR created (although my PR shifts the green one .5 to the right, so it’s in the middle of the eye).
While this create a horizontal rectangle it’s still not showing all of what the actual player sees. Now my question is: Why are we even taking the eyes for the Mirror Window?
Why can’t we query what the Camera, which the HMD is bound to, sees? That should have the normal (for example FullHD) resolution.
####################
The second question or discussion point is: How can we add Vive-independent UI to this window?
Games like “AudioShield” can be controlled via this Window while the VR Player is not getting affected by it.
This allows people to change things without interfering with the Player. It would also allow us to display information on this screen, like score etc.
AudioShield is created in Unity and I don’t have an example for UE4. That makes me feel like UE4 doesn’t support this out of the box.
I’m sadly not skilled enough in Render Thread things to know what I would need to do to enable us to actually have a WindowMirror, that shows a FullHD image, not bound to the Vive Resolution which can also have its own UI (Widgets).
####################
So if anyone here is interested in this, or maybe even knows a good chunk of the solution, it would be more than awesome to share and discuss our knowledge here.
My idea was to change the “SteamVRRender.cpp” a bit more by actually changing this:
[spoiler]
void FSteamVRHMD::D3D11Bridge::FinishRendering()
{
vr::VRTextureBounds_t LeftBounds;
LeftBounds.uMin = 0.0f;
LeftBounds.uMax = 0.5f;
LeftBounds.vMin = 0.0f;
LeftBounds.vMax = 1.0f;
vr::Texture_t Texture;
Texture.handle = RenderTargetTexture;
Texture.eType = vr::API_DirectX;
Texture.eColorSpace = vr::ColorSpace_Auto;
vr::EVRCompositorError Error = Plugin->VRCompositor->Submit(vr::Eye_Left, &Texture, &LeftBounds);
vr::VRTextureBounds_t RightBounds;
RightBounds.uMin = 0.5f;
RightBounds.uMax = 1.0f;
RightBounds.vMin = 0.0f;
RightBounds.vMax = 1.0f;
Texture.handle = RenderTargetTexture;
Error = Plugin->VRCompositor->Submit(vr::Eye_Right, &Texture, &RightBounds);
if (Error != vr::VRCompositorError_None)
{
UE_LOG(LogHMD, Log, TEXT("Warning: SteamVR Compositor had an error on present (%d)"), (int32)Error);
}
}
[/spoiler]
To only display the left eye from 0 to 1 horizontal and then map the green rectangle to the whole screen, but this would in the end only result in a 1080x1200 resolution. Not really ideal.
So what are your thoughts on this? Has this already been solved maybe? :x