Unreal Engine 4.7 preview GearVR signature file? — Oculus
New to the forums? Click here to read the "How To" Guide.

Developer? Click here to go to the Developer Forums.

Unreal Engine 4.7 preview GearVR signature file?

karrtoonkarrtoon Posts: 120
Art3mis
edited January 2015 in Samsung Gear VR
I've had success in building GearVR Unity demos, wasn't too bad. I just read that the UE4 4.7 preview has initial GearVR support. Does anyone have detailed instructions for building for GearVR for UE4.7? Where would I place the signature file in the project for example and are there any special settings I need to adjust before building the apk? (Besides lower draw calls in the project for mobile, etc) or do we need to wait for the next mobile SDK release to get started with this?

Update 01/31/15: Instuctions added by Epic on this thread https://forums.unrealengine.com/showthread.php?53999-Gear-VR-support He mentions
Engine/Build/Android/Java/assets as being the correct location for Oculus signature file, also that only C++ projects are supported at this time. (But you can still use blueprints) can just add empty c++ class to to Project to convert it. Thanks patimpatan!

Update 01/29/15 if you don't want to wait for 4.7 release: Edit: The following didnt work for me, may has useful info if you need help. Here is original thread: http://www.reddit.com/r/oculus/comments/2th9fj/fixed_unreal_engine_4_gearvr_samsung_eigp20/ "

Here are MarcelBlanck's instructions:
...might be possible on preview, but I did it on the master branch. It should be possibe on promoted also, master was only a few commits ahead.

1. Make sure all Verions SDK, ANT, NDK are standard for UE4 and on PATH. So just let the the UnrealEngine/Engine/Extras/Android/tadp-2.0r8-windows.exe do it's job
2. Checkout the master or promoted branch
3. Open Visualstudio and build the whole Project with x64 | Development Editor
4. After that build one mor time but only UE4 by rightclicking on it and with target Android | Development
5. In the explorer go to UnrealEngine\Engine\Source\ThirdParty\Oculus\LibOVRMobile\LibOVRMobile_041
6. Execute the InstallVRLib.bat
7. Open your Project with the build Engine Editor and make sure it has the Project Settings > Target Hardware to mobile and scalable, under Input select Default Touch Interface and clear it (we do not want that sticks)
8. Enable the GearVR plugin!
9. In UE4 Editor, I have set the Project Settings> Andoid SDK paths correctly to the one you build the engine with
10. Go to Project Settings > Android > APK Packaging and set Minimum SDK version to 19
11. Go to Project Settings > Android > Advanced APK Packaging and add <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only" /> (To bad they automated the Manifest production)
12. In the same category, a few lines below, add android.permission.CAMERA to the Extra Permissions
13. Check the rest of the settings is default, ES2 and arm 7 build selected
14. IMPORTANT - got to your Projects folder MyProject/Build/Android and create a folder named "assets" - put your downloaded generated Oculus signature file in that folder
15. Go to File > PAckage Project > Android > Android ETC2[/i]

DONE!

I still had a crash with the FPS Template, the android debug log said the Crosshair Texture was null... wtf. I deleted it in the project and I was able to run it, and look around with my GearVR! So make sure you check your adb logcat output and find the exact reason for a the problem if you get a black screen - Mostly it will be near words like Exception ot WINDEATH

If you want full Samsung controller support apply the patch in the original post here. I will now start to check what kind of events the build-in touchpad and Backkey throw. I also need to know how to access the GearVR Main Menu and how to go to Oculus Home. So still some work to do. Then the development fun can begin."

Comments

  • pittsburghjoepittsburghjoe Posts: 514
    Art3mis
    erm, this is how it's done with Unity: http://www.reddit.com/r/GearVR/comments/2qcryc/step_by_step_guide_to_building_apps_for_the_gear/

    not sure if that will help any
    i7 skylake, EVGA Classified, 2 EVGA 980 sc's, Thermaltake TR2 RX(1000W), 32GB DDR4, Win 10 on an SSD
  • pittsburghjoepittsburghjoe Posts: 514
    Art3mis
    i7 skylake, EVGA Classified, 2 EVGA 980 sc's, Thermaltake TR2 RX(1000W), 32GB DDR4, Win 10 on an SSD
  • karrtoonkarrtoon Posts: 120
    Art3mis
    Not Unity, but Unreal Engine 4.7. I am already able to build Unity GearVR content without any issues. Just want to see if anyone has been successful in building a GearVR project on UE4 4.7 preview 2. (A recent Epic dev video also said there was support added)

    http://youtu.be/kbmDnqXoCXo?t=1h13m25s
  • pittsburghjoepittsburghjoe Posts: 514
    Art3mis
    i7 skylake, EVGA Classified, 2 EVGA 980 sc's, Thermaltake TR2 RX(1000W), 32GB DDR4, Win 10 on an SSD
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    You can get the signature on this page:

    https://developer.oculus.com/tools/debug/
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • karrtoonkarrtoon Posts: 120
    Art3mis
    You can get the signature on this page:

    https://developer.oculus.com/tools/debug/

    Yup, I already have the signature. I am just not sure how or where to place it in my UE4 project. All of the people on that Unreal Engine forum link pittsburghjoe provided seem just as confused. https://forums.unrealengine.com/showthread.php?53999-Gear-VR-support

    Edit: I should be more specific, I try to import the sig file and it says "unknown extension" and won't let me.
  • dvddoedvddoe Posts: 4
    NerveGear
    you have to go to Project Settings\Platforms\Android and click on open Manifest Folder;
    in that folder ("project\Build\Android") create a folder named "assets" and copy your sig file in there
    you also need to edit the android manifest and get this between the "application" tags:
    <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>

    after you deploy, it will ask you to insert the Gear VR; unfortunately the only thing you'll see it's a black screen; I wasn't able to make any of the games/templates actually work in VR
  • karrtoonkarrtoon Posts: 120
    Art3mis
    dvddoe wrote:
    you have to go to Project Settings\Platforms\Android and click on open Manifest Folder;
    in that folder ("project\Build\Android") create a folder named "assets" and copy your sig file in there
    you also need to edit the android manifest and get this between the "application" tags:
    <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>

    after you deploy, it will ask you to insert the Gear VR; unfortunately the only thing you'll see it's a black screen; I wasn't able to make any of the games/templates actually work in VR

    Thanks, I'll see if I can at least get to the point where you are at and if I can get any further. I do have a popup window about missing android components when I try to build. I have everything loaded from android SDK manager and the tadp-2.0r8-windows.exe file is also loaded. Is there anything else I need to place in that manifest folder to get an APK to build?
  • dvddoedvddoe Posts: 4
    NerveGear
    karrtoon wrote:
    Is there anything else I need to place in that manifest folder to get an APK to build?
    Nope, that should be it.
    Just check the "\Engine\Binaries\Android" folder for the .apk and .so files.
    If they are missing (or the Android folder is missing), you need to do a build with Solution Configuration = Developer and Solution Platform = Android
  • karrtoonkarrtoon Posts: 120
    Art3mis
    Finally got rid of that android missing file error window. A box was not checked under project settings > packaging. Needed to put a check in "package .pak in APK" I will keep you updated on if I can get this to work. APK building now.

    Edit: argh folder empty, packaging failed, part of output log:
    "MainFrameActions: Packaging (Android (ETC2)): Program.Main: ERROR: ERROR: cmd.exe failed with args /c "C:\NVPACK\apache-ant-1.8.2/bin/ant.bat" -quiet debug
    MainFrameActions: Packaging (Android (ETC2)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
    MainFrameActions: Packaging (Android (ETC2)): Program.Main: AutomationTool exiting with ExitCode=1
    MainFrameActions: Packaging (Android (ETC2)): Domain_ProcessExit
    MainFrameActions: Packaging (Android (ETC2)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
    MainFrameActions: Packaging (Android (ETC2)): copying UAT log files...
    MainFrameActions: Packaging (Android (ETC2)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
    MainFrameActions: Packaging (Android (ETC2)): BUILD FAILED"


    Edit2: @dvddoe I am not finding Solution Configuration menu anywhere, any ideas where this is? Tried project launcher option on my device and got:
    Total time: 0 seconds
    BuildCommand.Execute: ERROR: BUILD FAILED
    Program.Main: ERROR: AutomationTool terminated with exception:
    Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: cmd.exe failed with args /c "C:\NVPACK\apache-ant-1.8.2/bin/ant.bat" -quiet debug
    Stacktrace: at UnrealBuildTool.Android.UEDeployAndroid.RunCommandLineProgramAndThrowOnError(String WorkingDirectory, String Command, String Params, String OverrideDesc, Boolean bUseShellExecute)
    at UnrealBuildTool.Android.UEDeployAndroid.MakeApk(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage)
    at UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor)
    at AndroidPlatform.Deploy(ProjectParams Params, DeploymentContext SC)
    at Project.Deploy(ProjectParams Params)
    at BuildCookRun.DoBuildCookRun(ProjectParams Params)
    at BuildCommand.Execute()
    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
    at AutomationTool.Automation.Process(String[] CommandLine)
    at AutomationTool.Program.MainProc(Object Param)
    at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
    at AutomationTool.Program.Main()
    Program.Main: ERROR: ERROR: cmd.exe failed with args /c "C:\NVPACK\apache-ant-1.8.2/bin/ant.bat" -quiet debug
    ProcessManager.KillAll: Trying to kill 1 spawned processes.
    ProcessManager.KillAll: UE4Editor
    ProcessManager.KillAll: Killing process: UE4Editor
    ProcessResult.StopProcess: Process UE4Editor successfully exited.
    Program.Main: AutomationTool exiting with ExitCode=1
    Domain_ProcessExit
    ProcessManager.KillAll: Trying to kill 0 spawned processes.
    copying UAT log files...
    RunUAT.bat ERROR: AutomationTool was unable to run successfully.
    BUILD FAILED
  • dvddoedvddoe Posts: 4
    NerveGear
    karrtoon wrote:
    Edit2: Not finding Solution Configuration menu anywhere, any ideas where this is?

    It's not a menu. in VS you have dropdown box next to the start debugging button which currently says "Development Editor"; you have to change that selection to "Development" and the dropdown box that says Win64 to Android;
    After you rebuild with this configuration you can switch back to the Development Editor - Win64 build
  • karrtoonkarrtoon Posts: 120
    Art3mis
    I just fixed the packaging error, the problem was I had placed the <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/> line you provided in the wrong spot between the application tags. I put it right above the line </application> in the AndroidManifest.xml and it packaged successfull. Will keep you updated.

    Edit: okay so If I change to sensor landscape orientation before I packaged it I can see the game, this seems to get it past the black screen issue you were talking about. But it is not in VR mode. If I slightly open the phone away from the GearVR after starting the sun temple app while covering the face proximity sensor I can see in there, and see the game is on, but not not automatically started the VR view mode hmm.
  • vrcovervrcover Posts: 209
    Brain Burst
    Please keep up updated here. Im still waiting for my Note 4 but really want to get started working on porting a small experience to Gear VR.
  • ofarrellmatthewofarrellmatthew Posts: 3
    NerveGear
    Preview 3 Seems to have been released - maybe some things are ironed out.
  • karrtoonkarrtoon Posts: 120
    Art3mis
    edited January 2015
    Just tried Preview 3 a few minutes ago. Same issues unfortunately. :( Except now I can see the screen in the default landscape orientation mode, it's not black anymore. It seem to automatically add the on-screen mobile thumb sticks to my project when I make an android build. Still not in VR mode, just regular mode. Tried compiling the 4.7 github branch last night, no luck either when launching.
  • sinothsinoth Posts: 67
    Hiro Protagonist
    karrtoon wrote:
    It seem to automatically add the on-screen mobile thumb sticks to my project when I make an android build.

    You can turn this off in Project Settings -> Engine -> Input -> Mobile -> Default Touch Interface. Press 'clear' to set to None.
  • karrtoonkarrtoon Posts: 120
    Art3mis
    Thanks, that got rid of thumbsticks at least. The project still in normal 2D mode. I wonder if there's something that's not telling it to enter VR mode? I wish there was a console and keyboard where I could try typing "stereo on" or similar command to test this.

    Edit: Does anyone know how I can autoexecute the command "stereo on" from the UE4 editor before packaging the project? I could try that out and see if it helps.
  • sinothsinoth Posts: 67
    Hiro Protagonist
    karrtoon wrote:
    I wish there was a console and keyboard where I could try typing "stereo on" or similar command to test this.

    Edit: Does anyone know how I can autoexecute the command "stereo on" from the UE4 editor before packaging the project? I could try that out and see if it helps.

    There is a console! Press 4 fingers at the same time to bring up the console. You can type any console command here AFAIK, like 'stereo on'.

    As for your other question, do you use Blueprints or C++? It's easy from Blueprints to add a "console" node to a Begin Play event (in the Level Blueprint for example) that will autoexec commands.
  • JackpJackp Posts: 3
    karrtoon wrote:
    Thanks, that got rid of thumbsticks at least. The project still in normal 2D mode. I wonder if there's something that's not telling it to enter VR mode? I wish there was a console and keyboard where I could try typing "stereo on" or similar command to test this.

    Edit: Does anyone know how I can autoexecute the command "stereo on" from the UE4 editor before packaging the project? I could try that out and see if it helps.

    You could execute that console command from the level blueprint. Call 'Execute Console Command' from begin play. I'm working on getting up to speed with where you are.
  • dvddoedvddoe Posts: 4
    NerveGear
    karrtoon wrote:
    Thanks, that got rid of thumbsticks at least. The project still in normal 2D mode. I wonder if there's something that's not telling it to enter VR mode?
    Are you sure you have the Gear VR plugin enabled? I don't think that they are quite there yet. They added some new files today to Engine/Plugins/Runtime/GearVR/Source/GearVR/ but it still doesn't work
  • karrtoonkarrtoon Posts: 120
    Art3mis
    As for your other question, do you use Blueprints or C++? It's easy from Blueprints to add a "console" node to a Begin Play event (in the Level Blueprint for example) that will autoexec commands.

    Thanks, I made the blueprint from your directions. When I do a "mobile preview" from the editor the right eye is dark and the left eye is split in two now. It also doesn't seem to listen to the command when I run the app after I insert the device into the GearVR. I'm guessing this command only executes when a device is detected. Similar to running that command on a PC with no rift connected, nothing happens.
    Are you sure you have the Gear VR plugin enabled? I don't think that they are quite there yet. They added some new files today to Engine/Plugins/Runtime/GearVR/Source/GearVR/ but it still doesn't work
    I do not see a plugin in my plugins list. Is this something I need to get from Github and compile again? Also where are you getting all of this info.. You've been pretty helpful so far.

    Edit: Got GearVR plugin from github, activated. Black screen in all screen orientations settings.
  • karrtoonkarrtoon Posts: 120
    Art3mis
    Bump, looks like Epic just added instructions. Only C++ projects supported at this time. Edit: by that he means (you can still use blueprints) can just add empty c++ class to Project to convert it. Thanks patimpatan!

    Correct location for osig is Engine/Build/Android/Java/assets

    Link: https://forums.unrealengine.com/showthread.php?53999-Gear-VR-support

    "Alright. For anyone who wants to grab the latest from the GitHub 4.7 branch, these instructions should get you started.

    Prerequisites:
    - Have a Note 4 and GearVR kit, and already be set up with the ability to build and deploy Android UE4 projects to your device
    - Grab 4.7 from GitHub and run the Setup.bat in order to get the latest binaries. Please make sure to re-run Setup.bat if you have already run it, because there are new libraries for GearVR support
    - Get an osig file for your device [url=fromhttps://developer.oculus.com/tools/osig/]fromhttps://developer.oculus.com/tools/osig/[/url]
    - Create an 'assets' directory within Engine/Build/Android/Java, and place your osig file in this assets directory. Your project *will not run* on device without this osig present in this directory at packaging time

    Build and Run the editor:
    - Run GenerateProjectFiles.bat to update your solution
    - Open ue4.sln in visual studio, and build and run the UE4 project in 'Development Editor - Win64' configuration

    Create your project:
    - Select the 'New Project' tab
    - Select the 'C++' tab (currently GearVR support requires a C++ project since plugins are not built into the default executables)
    - Select the 'First Person' template
    - Change the options to 'Mobile / Tablet', 'Scalable 2D / 3D', 'No Starter Content'
    - Name your project something like 'MyGearVR'
    - When visual studio opens up again, compile and run the MyGearVR project

    Configure and package your project for GearVR:
    - Go to the 'Windows/Plugins' menu item, and go to the Head Mounted Displays page - disable Oculus (optional) and enable GearVR, click 'Restart Now'
    - Select the 'Edit/Project Settings...' menu item
    - In the Android section, scroll to the top and click the 'Configure Now' button for Android support

    Set the Minimum SDK version to 19 or higher

    Select the 'Configure the AndroidManifest for deployment to GearVR' checkbox

    - In the Packaging section, optionally click the advanced down arrow in Project and disable 'Full Rebuild' in order to speed iteration times
    - Select the 'File/Package Project/Android/Android (ETC2)' menu item and package your project to a directory of your choosing

    Install and Run:
    - Connect your device and have it able to accept adb sessions. Please see the normal UE4 Android documentation for details if you're not familiar with this process
    - Run the installation script from within the directory you packaged to
    - On device, find your application icon, click it, and then attach the GearVR headset to the phone"
Sign In or Register to comment.