This is Ian from Elara and in this tutorial we will focus on
the point of the OculusGo VR headset from UE4. You'll need a recent version of
UE4. I'll dive into epic games launcher and download 4.19. OculusGo is an
Android device so navigate your engine's Extras Directory and run the Android
works installer to install all of the prerequisites.
Keep the default settings
and add API 21. This version is the minimum version that oculus accepts on
the online store. Android works also installs the Android debug bridge
(ADB for short).
Unselect Nsite Tegra if prompted.
You'll need to accept the terms
and conditions in order to continue.
Once the download is complete you'll need to restart your computer.
In the meantime grab the mobile device you intend to pair with OculusGo.
Install the Oculus app from your App Store
and follow the initial device setup if you haven't already.
Then enable developer mode in the "More Settings" panel of your paired Go headset.
Connect your go to your PC via the USB cable and open a command prompt window, type adb
devices and hit enter. Your headset will probably show as unrecognized.
Solve this by holding the headset
up to your face while it is still USB connected.
Check the check box and hit OK, then run ADB devices on your computer once more.
Lets set up a simple UE4 project to deploy to the Go.
Start by saving the map and opening your project settings.
Start off by giving your project a name and enabling "Start in the VR".
We'll want our project to default to the main map
so update the default maps in the maps and modes section.
The Go has no touchscreen so remove the Default Touch Interface
in the input section.
In the rendering section,
enable Multi-Sample Anti-Aliasing, Forward shading, and Instanced Stereo.
In the Android section press the "Configure Now"
button, then accept the SDK license if you haven't already.
Take a moment to replace your company
then update the minimum SDK version and target SDK
version 221. Enable full screen immersion on KitKat and above devices
and swap support OpenGL to ES 3.1.
Configure the Android manifest for
deployment to gear VR. Restart your project to apply changes and we'll move
on to setting up a simple stereoscopic scene.
Delete everything from the map
except for the player start and add a sphere static mesh actor with a scale of 400.
Now we'll prepare the material for the sphere.
In the materials detail panel
enable two-sided and set shading model to unlit.
We'll be viewing it from the
inside and only need an emissive channel.
Plug a texture sample node into the
emissive color channel if you don't have a stereo 360 image of your own you'll be
able to download one from the link in the description of this tutorial.
The top portion of the image will serve as our left eye and the bottom as a right eye
well map the UVs of the left eye first.
Do this by getting the texture
coordinates node and setting V tiling to 0.5 in the new nodes detail panel.
For the right eye use an Add node after the existing coordinate with a constant 2
vector of a 0 and 0.5.
We can choose between these two UV options with Lerp Node
using a 0 or 1 alpha to display the left or right eye.
Add a custom node with
the Float 1 output type.
In the code section type - return ResolvedView.StereoPassIndex;
The texture appears inverted inside the sphere.
To fix this we'll negate its scale on
the x-axis.
You should see the Go as an Android device in the launch drop-down,
click it to deploy to your Go.
Once the project has deployed and it shows is running
on your device, unplug the Go and take a look.
Distortion you see here is due to my camera's refresh rate. In the headset it should be running smoothly.
Thank you for joining us here at Elara.
We produced a tutorial
from modeling the OculusGo Hand Controller so be sure to check that out
and download the free model!
I've added a download link for this UE4 project in
the description below. Also please check out a Elara on the web (elarasystems.com)
and reach out if you'd like to join the Elara team.