Basically, what is necessary to do is to move a couple lines in the Engine\Plugins\Runtime\OculusRift\Source\OculusRift\Private\HeadMountedDisplayCommon.cpp file, method bool FHeadMountedDisplay::OnStartGameFrame():
bool FHeadMountedDisplay::OnStartGameFrame()
{
check(IsInGameThread());
if (!GWorld || !GWorld->IsGameWorld())
{
// ignore all non-game worlds
return false;
}
Frame.Reset(); // MOVE THESE LINES HERE
Flags.bFrameStarted = true;// MOVE THESE LINES HERE
I’ll notify Epic guys to integrate this fix into 4.8 and main UE.
I did some digging and I have not found a pull request from Art_Oculus. I will ask around to see if he has mentioned this to anyone else. However, until he submits a pull request we cannot begin the process of consideration/implementation of the suggestion that he has provided above.
I talked to and the fix is already integrated via perforce into UE4 main (CL #2607744). However, I am not sure if it will be a part of 4.8.2 (I just don’t know).
I am not a big fan of github. I tried to create a pull request, but I can’t make it to select only one particular commit, it always wants to grab more commits into the pull request.
I apologize for the miscommunication. I was referring to the integration of the solution into main (4.9). This issue did not make into the 4.8.2 hotfix as you said. However, I have included a link to the commit below if you would like to cherry pick this change list and integrate it into your project. You will need a source version of the engine if you don’t already have one. (I have included a link on how to build the engine from source). I have also provided a link to get you started on cherry picking change lists to integrate them into your project. I hope that this information helps.
I just installed 4.8.3 and now just having one window does NOT fix the problem anymore.VR flashes for about 1 full second, with tracking and the warning message, then blinks again and becomes fully black. A mirrored window shows it working, but with no head tracking.
This issue has been resolved internally. I don’t currently have another workaround for this issue, however if you are working from a source version of the engine you could try integrating the change list (provided in a post below) from github into your project.
Hmmm… I’ve check the source code of the 4.9-rel3 and the issue is definitely fixed there. I also use it a lot and I didn’t have any problems since the fix was applied…
I see. Yup, I see that that method was changed in 4.9 for some reasons. It should use IsHeadTrackingAllowed() (or, IsHMDConnected()) method instead of IsHMDEnabled().
For me VR preview is still broken on 4.9, latest preview builds built from source. I was waiting for the 0.7 runtime to see if it made a difference and sadly the error is still there. Preview window goes black and nothing shows up on the HMD. Standalone builds are working perfectly however. I’ve rebuilt the complete engine source multiple times to no avail.
Attached. The preview failing is when I launch the external preview window specifically and alt+enter. The in editor preview actually works every time. The logs attached show where it hangs or stops outputting logs before I kill it, the works log shows what happens when it randomly works, and the after launching log shows that if I launch and have it hang, then launch the oculus config tool and show the demo scene and hit escape the app will un-hang and actually show the scene perfectly. Of course UE4 is using the 0.6.0.1 SDK so maybe there is another fix in 0.7, but as it stands, even with the new runtime and 0.6 SDK I have that black screen hang.