IHeadMountedDisplay Not Working On Mobile

Hello,

I am implementing the IHeadMountedDisplay and IStereoRendering interface classes available inside the engine, but it doesn’t want to respond in the mobile Android build. It works on Window builds. Secondly. I have implemented the code similarly to how the Oculus has there’s setup inside a plugin but wont work with Android either.

Am I missing something here to make things mobile compatible?

I will need some more info as to the actual issues you are having.

For the second one, make sure that you have the proper platforms Whitelisted in your .uplugin file (if you just copy and renamed the Oculus one, you may have missed it).

And make sure to add the plugin to the list in BaseEngine.ini

Josh

Thanks for the response. Seems like the plugin magically started working today on mobile without modifications.

The .uplugin written like this:

“Modules” : [{ “Name” :
“PluginName”, “Type” : “Runtime”,
“WhitelistPlatforms” : [ “Win64”,
“Win32”, “Android” ] }]

And .ini file written like this:

[Plugins]
+EnabledPlugins=“PluginName”

As for the IHeadMountedDisplay, it just doesn’t work for mobile, but works fine for Windows. I set EHMDDeviceType::DT_OculusRift as the enum type so that the shaders get initialized in the postprocess classes. I might suspect that maybe it’s the values I am setting inside GetHMDMonitorInfo(MonitorInfo& MonitorDesc). Wrote something like this:

MonitorDesc.MonitorName = “MonitorName”;
MonitorDesc.MonitorId = (long)1;
MonitorDesc.DesktopX = 0;
MonitorDesc.DesktopY = 0;
MonitorDesc.ResolutionX = 1080;
MonitorDesc.ResolutionY = 720;

I set the mobile preview screen resolution to 1080x720. Attached screencaps below to show standalone and mobile previews.

Another issue is that stereo seems to be glitchy (both viewports are rendered on right side of split screeen) when HRD rending is enabled. Transparent window shaders seem to only render on one side.

9494-standalone2.png

9495-mobile2.png

The scene rendered with HRD rendering for mobile

9496-mobilehdr2.png

I have just learned that the shaders called from PostProcessHMD are not being called in mobile builds, so IHeadMountedDisplay class is not being initiated from the start. Anyone have solution to this issue, or can point me to the right direction?

The postprocess issues have a temporary workaround in this github commit:

https://github.com/EpicGames/UnrealEngine/commit/90a9af94c5fd47dd285c2c20d3ff8132a89f043a

Another commit that you might be interested in is this one, which correctly handles GetHMDMonitorInfo() returning false, which probably isn’t the case with your HMD code, but just in case:

https://github.com/EpicGames/UnrealEngine/commit/fea791d32a04f01834c5f586ccf9e5b655c4b5ea

Plug-ins also weren’t working on mobile until a month or so ago, but if you’ve made it this far, it seems likely that you already have the fix for that issue.

Thanks for the links JJ. I am currently compiling the source for 4.2.1 and will make these changes to see how it goes. Still very confused to why the IHeadMountedDisplay is not being initiated, since IsHMDEnabled() is being passes true and the code runs correctly for Windows.

The temporary workaround works for the transparent materials for HDRmobile enabled. Is there a workaround for non HRDmobile? My IHeadMountedDisplay issues are yet to be resolved on mobile. Anywhere in the source where I could make possible modifications to make it work properly?

Hi Pal,

I’m also interrested in the creation of a stereo plugin.
I’ve began to build one from the base of the Oculus’ plugin … but if you could send me or post you code, you’ll be an angel !!

Moreover, have you succeed to run your plugin on Android with stereo ?

Thanks /