Download

Sharing Gear VR BP : android orientation -> camera orientation

Migrating from Oculus -> Mobile, this bp set is a mix of things we found and things we cooked ourselves.

  1. Each device has its own orientation for the sensors
    Android != iOS

  2. Requires smoothing

Below in the attachments are the blueprint components.

Level BP : level bp passes input to character:
Ignore CollectionParameter Roll scalar

The First Person Player Character BP : Event Graph contains a few macros.
getFusionOrientation
getGravityOrientation
NoiseFilter

https://www.facebook.com/media/set/?set=a.1662236124011890.1073741835.1535188926716611&type=1&l=e36f45ec7a

The image upload didn’t seem to work.

If anyone has any suggestions on how to make this smoother or more responsive, please share your ideas!

dbd4ab4019458923849c9d2d793dbc977b7a8ee2.png
Event graph.png
getGravityOrientation.png
level bp.png
a84bdad3db1cdeec8a37052fc3880e1f0f7bab7e.png
f7e664061f524438ef41f9f230b22bc84e61cec0.png
project settings _ input.png

Correct me if i’m wrong but doesn’t the gearVR plugin handle all of that - if you want to control a character with your head movement then either use get controller or make the character components a child of the camera as per: https://docs.unrealengine.com/latest/INT/Platforms/GearVR/QuickStart/1/index.html
and it’s ultra smooth :wink:

I can’t figure out how to properly view the attachments but if you’re using the default Android sensors this is probably more a solution for CardboardVR rather than GearVR?

That’s what we thought, but it never quite worked. This was our work around, and it is general enough to work on android.

This allows you to ad-hoc a Google Cardboard VR like experience, with a console command: stereo on

Definitely would not recommend using a workaround for GearVR as the sensors in the headset itself are far superior then the android sensors in the phone itself. If you really wanted to get it running on GearVR then I’d go back and get it working on GearVR with the default GearVR plugin which works with brilliant tracking as seen on finished projects here: https://forums.unrealengine.com/showthread.php?70475-Well-done-all-UE4-Oculus-Mobile-Jam-finalists!&highlight=vr+jam

I forget what I needed to change exactly but there were some camera settings that I needed to tweak for the DK2 version compared to the GearVR version of my project.

Using your workaround sounds interesting for Cardboard however even there I think serious cardboard users are unlikely to pay for an app with the proper cardboard SDK to adjust lens distance / distortion / etc. - if only Epic added it as a plugin for out of the box tracking as well :frowning:

The appropriate lens distortion can be calculated using the Cardboard VR SDK.

It tracks rather well, nearly as well as the GearVR setup. Depending on where you are on earth, the gravity differs so this blueprint accounts for that as well.

If you don’t want to (or can’t) fork over 200$ for Samsung Gear VR, then this is a workaround that lowers the cost of entry for VR (enable Developer mode).

Don’t get me wrong I love cardboard as well - but would not use the android sensors if I was making a gearvr project.

Have you added the CardboardVR SDK to UE4?!? Many people here would love a share of that: https://forums.unrealengine.com/showthread.php?55696-New-Google-Cardboard-SDK :slight_smile:

This is my attempt at Google Cardboard VR like functionality. Unfortunately, the Unreal Engine is quite demanding on current smartphones. Only a few higher end phones have the required specs/ recommenced specs.

This is awesome. Thank you so much for sharing.

I’ll be happy to convert this to C++ components/plugin, but first I need to just check.

Are you sure there is now way to achieve this with SimpleHMD?

I only ask as we really need to lean on the engine, if possible, for things like this.

For example your noise filter, whilst effective, can likely can be improved with kalma filters etc.

I wonder if this has already been solved with SimpleHMD?

Hello,

I am having problem with GearVR orientation being too connected to player camera. Any way to separate these entities? I want to make rail shooter for Gear.
I posted more on problem here:

Simple HMD does not work for s6 in dev mode, as I was trying to work around the requirement of having the gear vr. Without the gear vr, it does not seem to track things. My noise filter, allows one to adjust for location based gravity (kinda silly, dorky).

Minxies have you had any luck getting VR to work in mobile for UE4?

Great news, official Google Cardboard support seems to be coming to the engine!

See here: https://www.reddit.com/r/oculus/comments/4iq3rq/androidvr_likely_to_be_announced_next_week_at/

It looks like the existence of a new “AndroidVR” (Google Cardboard) plugin was leaked in the breakdown of the latest 4.12 Preview 3 release notes.

This note has since been pulled.

It is slated that the Google Cardboard SDK will be relaunched as AndroidVR this coming Google IO.

From the looks of it, AndroidVR looks to be a collaboration of sort between Epic Games and Google.

Best,
Minxies

Hi there, I’ve been reading this thread with great interest, thanks for sharing. I’m currently attempting to use the Google VR plugin for mobile and make it render 1 camera (monoscopic) instead of 2. The console commands stereo off and vr.Stereoenabled False both works, but they also disables tracking which I need. A friend and I have been trying to modify the Google VR plugin source files without luck. Did you ever come across a way of disabling stereo but keep the HMD tracking active?

did u ever find a solution to this ??

Hi there, no, my colleague and I ended up using v. 4.17.2 that apparently uses a newer version of the Google Plugin? Here you can disable stereo without disabling tracking. We even compiled the source code for the engine and plugin to try and figure out how to fix it manually. No success unfortunately. Only solution we found was using 4.17.2 and run console command Stereo Off

If you find a better solution please let us know :smiley: We’d love to use 4.19 instead