Skip to main content
Up and Coming
August 12, 2014

UE4 QA 07_2014 (4.3) integration with Oculus SDK 0.4!

Hey guys,

Finally, it is here. Oculus SDK 0.4 integration with UE4 4.3 (July'14 QA) is released.
Licensees can download the integration package from our web-site (Developers -> Downloads). This integration will patch the codebase up to 4.3.1.
GitHub $19-subscribers can access it through https://github.com/Oculus-VR/UnrealEngine/tree/4.3 (also 4.3.1 changes are already applied).

Note, you'll need to install the latest 0.4 Runtime for this integration to work. Once you've installed the Runtime your previous UE4 + Oculus (0.3-based) will stop working, however, it is easy to restore its functionality by two simple steps:
1) Using the Oculus icon in the taskbar switch display mode to 'Extend Desktop';
2) Using the same icon, run the 'Configuration Utility', go to the 'Tools' -> 'Advanced' -> 'Pause Service...'. The service will be automatically restarted once you run 0.4-based app.

We are working with Epic to integrate this code to upcoming UE4 4.4, will see how it goes (can't promise anything; in worst case scenario we will provide our own integration for 4.4 as well).

Note, there are several known issues with this integration, the major ones are as follows:
1) OpenGL doesn't work in Windows (in both modes - "Direct HMD Access from Apps" and "Extend Desktop to HMD".
2) There is no timewarp on Mac; will be there in the next update.
3) If you have issues in "Direct HMD Access..." mode - switch to "Extend Desktop": we are still actively working on improving our display driver.

If you have any issues or questions - post them here, I'll try to monitor this thread regularly.
    This topic has been closed for replies.

    106 replies

    Participant
    August 13, 2014
    I was able to build Development Editor and Test Game fine after sorting out the ovr.h issue in the Oculus 4.3 branch. However if I build CouchKnights it will not go to stereo mode and ovrversion does not work saying unknown command. The plugin is active and i find ovrversion string in the compiled exe. At a loss how to troubleshoot but will try setting breakpoints and step through I suppose.

    When I built from master from official branch over weekend it was working mostly fine (though it broke today) but lacks the current updates. Course I was hoping for direct to hmd working but I suppose that will be another day.
    Up and Coming
    August 13, 2014
    @tabbott
    It will be nice if you had enlightenment regarding the building issue...
    Did you do anything special to make it work ?

    Are you a dev that already had visual studio, Github working etc... or did you install things for that... ?
    Anything you could add to "I was able to build Development Editor" ?
    (issue regarding alt.libs etc...)
    Welcome to http://www.SynthesisUniverse.com it's out there, on the Oculus Share : https://share.oculus.com/app/synthesis-universe--maze--intro-experience
    August 13, 2014
    "OlivierJT" wrote:

    -----------------
    My process:
    1. Install Windows Driver Kit ("Build Environment" only)
    2. Create a new libovr by building the project LibOVR.vcxproj found in LibOVR\Projects\Win32\VS2013. When doing this I had to add the include path and the library path to ATL as previously described by danielandersen.
    3. Build my own application. Here I had to add the ws2_32.lib as well as the ATL library paths.
    -----------------
    I am trying..... but this is uncharted waters for me...
    2. looks so obvious... but it's not ^_^

    I did 1.
    I have located the infamous atls.lib....
    Have to figure out "2"....
    will report back....
    I tried the "remove the atls.lib references" :
    https://github.com/jherico/OculusSDK/commit/2368d529b5832d69f89d4167a30f7a93195d57fd
    But without success...


    I managed to get UE4 4.3 built from github using VS 2013 Express this morning.

    Sounds like you've already done Step 1: Installing the Windows Driver Kit.

    For Step 2 (building a new libovr dll), here are some more explicit steps, since it sounds like much of this is unfamiliar to you :)


    • Download the Oculus 0.4.1 SDK.

    • Open LibOVR\Projects\Win32\VS2013\LibOVR.vcxproj in VS2013

    • Select the 'Release' solution configuration and your target 'Platform' solution platform (e.g. x64), either using the drop-downs in the toolbar, or via Build > Configuration Manager

    • In the LibOVR project properties, find the VC++ Directories tab and:
      - For All Configurations and All Platforms, append to Include Directories the path to the ATL includes (for me, was C:\WinDDK\7600.16385.1\inc\atl71;)
      - For Release Configuration and your target Platform, append the path to Library Directories the ATL libs path (for me, was C:\WinDDK\7600.16385.1\lib\ATL\amd64; for x64)

    • Build the LibOVR project (press F6)

    • Copy the resulting libovr64.lib file (in my case LibOVR\Lib\x64\VS2013\libovr64.lib) over the one in the UE4 SDK (in my case Engine\Source\ThirdParty\Oculus\LibOVR_04\Lib\x64\VS2013\libovr64.dll)


    Now, for me, Step 3 was to get UE4.sln to compile by fixing the 'LNK1181: cannot open input file 'atls.lib' linker error.

    The output of the diff command below shows the changes I made. This is a 'quick-and-dirty' change to get it to compile on my machine, not a proper fix. You'd need to adjust the ATL library paths, for example, if you put the Windows Driver SDK in a different place.


    $ git diff -w
    diff --git a/Engine/Plugins/OculusRift/Source/OculusRift/OculusRift.Build.cs b/Engine/Plugins/OculusRift/Source/OculusRift/OculusRift.Build.cs
    index 582bee6..c74d8a8 100644
    --- a/Engine/Plugins/OculusRift/Source/OculusRift/OculusRift.Build.cs
    +++ b/Engine/Plugins/OculusRift/Source/OculusRift/OculusRift.Build.cs
    @@ -38,7 +38,6 @@ namespace UnrealBuildTool.Rules
    if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
    {
    PrivateDependencyModuleNames.AddRange(new string[] { "D3D11RHI" });
    - PublicAdditionalLibraries.Add("atls.lib");
    }
    if (Target.Platform == UnrealTargetPlatform.Mac)
    {
    diff --git a/Engine/Source/ThirdParty/Oculus/LibOVR.build.cs b/Engine/Source/ThirdParty/Oculus/LibOVR.build.cs
    index c4adc27..46bf6cb 100644
    --- a/Engine/Source/ThirdParty/Oculus/LibOVR.build.cs
    +++ b/Engine/Source/ThirdParty/Oculus/LibOVR.build.cs
    @@ -39,6 +39,14 @@ public class LibOVR : ModuleRules
    PublicAdditionalLibraries.Add("Wtsapi32.lib");
    //PublicAdditionalLibraries.Add(LibraryName + "d.lib");
    //PublicDelayLoadDLLs.Add(LibraryName + ".dll");
    + if (Target.Platform == UnrealTargetPlatform.Win32)
    + {
    + PublicLibraryPaths.Add("C:/WinDDK/7600.16385.1/lib/ATL/i386");
    + }
    + else
    + {
    + PublicLibraryPaths.Add("C:/WinDDK/7600.16385.1/lib/ATL/amd64");
    + }
    }
    else if ((Target.Platform == UnrealTargetPlatform.Mac))
    {


    Having followed the above steps, UE4 builds and runs for me, and works with the Oculus 0.4.1 runtime in both Direct and Extended mode. Performance in Direct mode is a non-starter, and performance in Extended mode is, on my hardware, insufficient unless I start turning settings down substantially. But it works :D
    Up and Coming
    August 13, 2014
    "mmcgill" wrote:
    Having followed the above steps, UE4 builds and runs for me, and works with the Oculus 0.4.1 runtime in both Direct and Extended mode. Performance in Direct mode is a non-starter, and performance in Extended mode is, on my hardware, insufficient unless I start turning settings down substantially. But it works :D

    Building now following your advice. Hopefully this will work! My CPU doesn't have SSE 4.1, so the built in implementation in UE4.3 has been no go for me (it works emulated, but performance is abhorrent). I'll be sure to stop back here to let you know either way how I got on. Thank you for the help anyways.
    Up and Coming
    August 13, 2014
    And that appears to have worked. Thanks to everyone who helped those of us who don't really know what we're doing with this kind of stuff get it compiled!
    August 13, 2014
    "plagiarize" wrote:
    And that appears to have worked. Thanks to everyone who helped those of us who don't really know what we're doing with this kind of stuff get it compiled!


    Excellent!
    artyom17Author
    Up and Coming
    August 13, 2014
    Sorry guys for the hassle. We are definitely removing ATL dependency from our lib, that was a mistake. You can follow the solution posted by mmcgill (thanks!) and I'll update our integration on github ASAP (to remove the ATL).

    As I said, there is a pretty big chance that 0.4.x integration will be in the upcoming UE4 4.4 out of the box. So, if you are not familiar with Visual Studio and building UE4 just wait till it is released.
    Up and Coming
    August 13, 2014
    @mmcgill
    Ha ! there you go ^_^
    Something I understand ! Thank you so much, I was able to follow your directions !

    Now step 3....
    I don't know what a diff is... I just wiki is but... okay....

    So I changed the UE4 properties project to the same as the LibOVR.... compiled.... and.... and....

    SUCCESS !!

    I am now the proud owner of : "MY UE4Editor 4.3.1 0.41 Rifted"
    Very very cool !

    Mmcgill, you don't post often, but when you do : KUDOS !
    You are the man ! (if you are one of course !)
    Thank you so much. ^_^
    Welcome to http://www.SynthesisUniverse.com it's out there, on the Oculus Share : https://share.oculus.com/app/synthesis-universe--maze--intro-experience
    artyom17Author
    Up and Coming
    August 13, 2014
    Glad the solution of mmcgill worked for you, guys!
    Anyway, I've just posted a fix that removes ATL dependency completely. You need to sync to the latest revision and re-download and re-unpack the .zip file (see README.md, note, the link has changed).
    Up and Coming
    August 13, 2014
    And just when you think it's over...

    BUILD FAILLED...
    Build a project package :

    ERROR: Exception in AutomationTool: No files found to deploy for xxx

    MainFrameActions: Packaging (Windows (64-bit)): Stacktrace:    at DeploymentContext.StageFiles(StagedFileType FileType, String InPath, String Wildcard, Boolean bRecursive, String[] ExcludeWildcard, String NewPath, Boolean bAllowNone, Boolean bRemap, String NewName) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\DeploymentContext.cs:line 286

    MainFrameActions: Packaging (Windows (64-bit)): at BaseWinPlatform.StageExecutable(String Ext, DeploymentContext SC, String InPath, String Wildcard, Boolean bRecursive, String[] ExcludeWildcard, String NewPath, Boolean bAllowNone, StagedFileType InStageFileType, String NewName) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Win\WinPlatform.Automation.cs:line 20

    MainFrameActions: Packaging (Windows (64-bit)): at BaseWinPlatform.GetFilesToDeployOrStage(ProjectParams Params, DeploymentContext SC) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Win\WinPlatform.Automation.cs

    MainFrameActions: Packaging (Windows (64-bit)): :line 128
    MainFrameActions: Packaging (Windows (64-bit)): at Project.CreateStagingManifest(ProjectParams Params, DeploymentContext SC) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\CopyBuildToStagingDirectory.Automation.cs:line 156

    MainFrameActions: Packaging (Windows (64-bit)): at Project.CopyBuildToStagingDirectory(ProjectParams Params) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\CopyBuildToStagingDirectory.Automation.cs:line 699

    MainFrameActions: Packaging (Windows (64-bit)): at BuildCookRun.DoBuildCookRun(ProjectParams Params) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 237

    MainFrameActions: Packaging (Windows (64-bit)): at BuildCommand.Execute() in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\BuildCommand.cs:line 37

    MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Automation.cs:line 367

    MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Process(String[] CommandLine) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Automation.cs:line 335

    MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.MainProc(Object Param) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 99

    MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param) in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Utils.cs:line 610

    MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.Main() in r:\GitHub_Clone\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 50

    MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: No files found to deploy for R:\GitHub_Clone\UnrealEngine\Engine\Binaries\Win64 with wildcard UE4Game.exe and exclusions

    MainFrameActions: Packaging (Windows (64-bit)): ProcessManager.KillAll: Trying to kill 0 spawned processes.



    From :
    https://answers.unrealengine.com/questions/18891/packaging-failed.html

    "Switch the configuration of UE4.sln from "Development Editor" to "Development" and recompile, your problem will be solved. The configuration is "Development Editor" by default, and it includes only the editor."


    Is that a viable solution ?

    I tried running the editor in Admin mode also...

    I clicked as advised "UnrealVersionSelector-Win64-Shipping.exe"
    and make sure my project launch with "my build" of Ue4...
    But nope...

    (The project build perfectly with the regular 4.3.1)
    Welcome to http://www.SynthesisUniverse.com it's out there, on the Oculus Share : https://share.oculus.com/app/synthesis-universe--maze--intro-experience