Get AR camera image always returns false in 4.25

I am not able to set the camera texture in my AR passthrough material because Get AR Camera Image always returns false, this was working fine in 4.24 but appears to be broken in 4.25. Instead I am using the ARkit Passthrough Camera node in my material but this does not always produce correct results on newer IOS devices, often resulting in stretched UVs

I’ve reported this as a bug a few weeks ago but they still haven’t confirmed anything, they replied asking if i can verify the following requirements are met with the AR project:

  • The source image does not use texture compression
  • A valid AR sessions has started before the runtime image is called

I replied explaining that yes the AR session is started before I call the runtime image and no the source image does not use texture compression. To reproduce the bug all they need to do is open the AR template, add Get AR Camera Image to a blueprint and use a print string to check if its valid, it will return false every time. Works fine in 4.24 but completely broken in 4.25

Would you mind reporting this bug?

Mobile AR in Unreal Engine is a broken mess, but maybe it helps.
Thanks!

I was so confused for the longest time yesterday. Thanks for reporting the bug. Any updates on the topic would be much appreciated. I have an older solution which “kinda” works, but I don’t get the color space to match in 4.25. This solution is used as an Post Process Blendable in combination with Stencils.

Hey guys!

I found a solution which works for 4.25 Actually the material in the AR Kit content folder almost works. There is just one important setting you have to change. The important part is that you have to set the “Blendable Location” to “Before Tonemapping”. The original material is called “ARKitCameraMaterial” which you can use as base and find in the AppleARKit Content folder from the plugin.

Use this as Post Process blendable in combination with Stencils. Make sure you have “Custom Depth-Stencil Pass” set to “Enabled with Stencil” in Project Settings - Rendering - Postprocessing. Enable “Render CustomDepth Pass” on the Static Mesh Components and set the “CustomDepth Stencil Value” to something of your liking. I was using 1 as you can see on the screenshot below. Additionally in the material you can “Enable Stencil Test” in the advanced section of the Post Process Material details section. This way you don’t need to create a custom stencil test logic in the material (as seen in my previous answer).

Hi, thanks for this, I’ve also been using this material successfully, but instead of the changing the material settings I had Mobile HDR checked in project rendering settings and that seemed to work for me.

The only problem I had with this material was the UVs on newer IOS devices (iPhone8 & iPhone11) were not correct and caused the camera image to be flipped or stretched. Changing the device orientation to portrait also caused a similar problem.

Have you guys experiences these issues?

Hm interesting…I had to do this besides having “Mobile HDR” checked.

Oh then I probably haven’t come across this issue, because I only tested it on an iPad 12.9’’ Pro (2018) thus far. ■■■■ I really need this to work. Funny enough I’ve used this exact setup with various models with prior engine versions sucessfully.

I just noticed that my material is slightly different to yours. Instead of using the texture coordinate node I’m using the Map AR Passthrough Camera UVs node with ScreenPosition UVs plugged in, which works for me.

I just tried your material set up on my iPad 9.7" 6th gen and the UVs were flipped, very strange.

So you’re saying that your material setup does work for all iOS devices then? It’s getting more and more confusing.

My material setup seems to work correctly on iPhone6, iPhoneSE and iPhone7 and iPad 9.7" 6th gen but it does not work on iPhone 8 and iPhone11 pro, these were the only devices I could test on.

Earlier I tested your material on the same iPad 9.7" 6th gen and it did not work. It looked like the UVs were flipped.