microsoft / Microsoft-OpenXR-Unreal

An Unreal Engine game plugin providing additional features available on Microsoft's Mixed Reality devices like the HoloLens 2 when using OpenXR.
MIT License
161 stars 52 forks source link

Support for UE 5.2? #109

Open Tim-Potratz opened 1 year ago

Tim-Potratz commented 1 year ago

Hi, just what the title says. Many thanks in advance.

james-yoo commented 1 year ago

I also want to use this plugin in UE5.2!

bvaibhav1 commented 1 year ago

Same, i updated the string to 5.2 in plugin but getting and error Engine\Plugins\Runtime\OpenXR\Source\OpenXRHMD\Public\OpenXRCore.h(15): error C2065: 'XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FB': undeclared identifier

demonixis commented 1 year ago

Any news on this please? Also 5.3 is just released, can we get an easy way to upgrade?

Renbry commented 11 months ago

Hoping for UE 5.3 as there's lots of stereo rendering fixes/improvements. We'll have to hope!

shiena commented 11 months ago

Unfortunately, Hololens/Hololens2 has been removed from the supported XR devices since UE5.3. https://docs.unrealengine.com/5.3/en-US/supported-xr-devices-in-unreal-engine/

greenwoodms06 commented 8 months ago

Bump... 5.2, 5.3, and/or 5.4 (soon)? These headsets are quickly going to turn into very very expensive paperweights without this and UXTools!

Olli1080 commented 8 months ago

Sadly it appears to become exactly that. https://www.windowscentral.com/software-apps/windows-11/microsoft-is-killing-its-windows-vr-platform-announces-deprecation-of-windows-mixed-reality

greenwoodms06 commented 8 months ago

This is quite disappointing if this really does mean the end of improvement/maintenance of all these tools. UE is getting so good just when MSFT gives up! SMH... The future was looking so beautiful...

Olli1080 commented 8 months ago

I've updated it for 5.2 if someone needs it https://github.com/Olli1080/Microsoft-OpenXR-Unreal/tree/5.2_plugin Beware that you have to build the engine from source since there is a bug in UE 5.2 preventing you from chosing any installed toolset for HoloLens builds.

The patch is how i got rid of the bug. ue5_2_1_hololens.patch

bvaibhav1 commented 8 months ago

Nice, and thanks! Will try it out, so the release version of source 5.2 should work with it? I assume after compilation choosing the packaging option from Editor will also work?

Renbry commented 8 months ago

You just made my day! Wohoo!

It seems to enable on a vanilla UE 5.2. I'm only interested in Remote Rendering so perhaps the advice to build from source only applies to doing HL2 compatible builds (?)

Olli1080 commented 8 months ago

@bvaibhav1 yes the patch is for the release branch 5.2(.1) of the unreal engine source repo. Choosing packaging options did work for me, pls tell me if you encounter any error.

@Renbry Yes the patch only applies to HL2 packaging from the engine.

Renbry commented 8 months ago

I may have got my hopes up...

"Open XR Holographic Remoting" (in Project Settings\Platforms ) doesn't seem to connect to the Hololens like usual, nor does the project have "VR Preview" as an option. Somehow the plugin is loaded succesfully but doesn't function in the way it did in UE 5.1 (For the purpose of remote-rendering)

Dang!!

PierreEVEN commented 6 months ago

Hoping for UE 5.3 as there's lots of stereo rendering fixes/improvements. We'll have to hope!

I managed to make the plugin to work in 5.3 ! But it will only work by streaming from the PC. (as the support for the hololens plateform has been removed from the engine)

I've removed the parts that don't compile (like the ability to render the camera in a texture, which could probably be fixed.. I didn't do more researches because I don't need this feature but it doesn't look it could be a problem)

It's not that hard to port and it works pretty well so far. But keep in mind you will never be able to build an embeded app anymore in 5.3.

Renbry commented 6 months ago

I'd LOVE to just stream to the device. We use the 3090/4090 to render the nanite/heavy Unreal features and have lamented the 5.1-only official plugin. I'd love to try this 5.3 version!

PierreEVEN commented 6 months ago

Yeah it works pretty well (with only a mid-end laptop GPU) We're using it for a similar use case.

I can't share our version right now because we added some wip changes and proprietary code, but I can replicate these changes on a clean version of the plugin when I have time... maybe in a few weeks. you can try on your own in the meantime The port to 5.2 from a previous post is close to work with the 5.3

PierreEVEN commented 6 months ago

I'd LOVE to just stream to the device. We use the 3090/4090 to render the nanite/heavy Unreal features and have lamented the 5.1-only official plugin. I'd love to try this 5.3 version! I finally had the time tonight !

This version of the plugin works with UE 5.3 https://github.com/PierreEVEN/Microsoft-OpenXR-Unreal/tree/5.3

I disabled some features so if someone wants to add a PR to fix it you're welcome :)

Renbry commented 6 months ago

Tested and working this side! thank you so much @PierreEVEN ! I'm going to test QR codes and a couple of other things. Is there a clear list of what you needed to disable to have it work ? Thanks again!

PierreEVEN commented 6 months ago

I've comented some bunch of code of the camera to texture class and in the secondary view configuration. You can find it by searching "@TODO 5.3 : removed for 5.3" in the source code.

bvaibhav1 commented 6 months ago

@bvaibhav1 yes the patch is for the release branch 5.2(.1) of the unreal engine source repo. Choosing packaging options did work for me, pls tell me if you encounter any error.

@Renbry Yes the patch only applies to HL2 packaging from the engine.

Hello @Olli1080 if i package from editor it does not compile the source as it used in to in 4.27. I had to manually compile HoloLens target with visual studio. The packaging worked after that from editor.

Also the app crashes on launch, without dumping any logs :(, when deployed on Hololens. Is there a way to debug the crash? Should i package in debug? For 4.27 usually development mode will give me logs.

Olli1080 commented 6 months ago

Yes the workflow for deployment is somewhat cumbersome in UE5. (Compilation in VS on every single change) My guess would be that the app crashes before the logger is started. You should consider temporarily removing part of your code to reproduce which section causes your app to crash.

bvaibhav1 commented 6 months ago

Yes the workflow for deployment is somewhat cumbersome in UE5. (Compilation in VS on every single change) My guess would be that the app crashes before the logger is started. You should consider temporarily removing part of your code to reproduce which section causes your app to crash.

Thanks for the quick revert, yes, compiled the sample and that works.

Olli1080 commented 1 month ago

Fyi i've had a HoloLens 2 at my hand and made a fork for 5.2.1 which allows you to build to device with C++20. https://github.com/Olli1080/UnrealEngine/tree/5.2.1 It also works around an issue where the app instantly crashes if in debug because of an AudioStreaming issues related to microsoft/MixedReality-UXTools-Unreal#69

vcstkv commented 1 month ago

@Olli1080 Have you faced any issues when building msft example for arm hololens? I've tried your forks for 5.2.1 and 5.4.3 and got internal compiler errors every time I built for hololens target.

operand 1: The given operands don't match
10:39:31:315    2>   inlined at C:\Users\vtekaev\repo\UnrealEngine\Engine\Source\Runtime\Experimental\Chaos\Private\Chaos\HeightField.cpp(505) <call to MakeVectorRegisterFloatFromDouble>
10:39:31:315    2>   while compiling `Chaos::THeightfieldSweepVisitorCCD<Chaos::FConvex>::VisitSweep'::`2'::<lambda_1>::operator()
10:39:31:365    2>C:\Users\vtekaev\repo\UnrealEngine\Engine\Source\Runtime\Core\Public\Math\UnrealMathNeon.h(405): fatal error C1001: Internal compiler error.

UPD. I successfully resolved this issue by manually specifying toolchain version to 14.38 instead of 14.41

Olli1080 commented 4 weeks ago

Yes i've encountered the same issue while building the engine with the most recent toolchains. 14.38 is the recommened version by unreal engine which may be an indication for some msvc issues.