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
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:
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.
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?
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:
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?
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 ?