arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

[HowTo] stereoEnabled check in URP not working

Open Phantomxm2021 opened this issue 3 years ago • 3 comments

  if(!m_CameraAR.stereoEnabled)

This code doesn't work in URP.

Phantomxm2021 avatar Aug 18 '22 09:08 Phantomxm2021

Any update for this problem?

Phantomxm2021 avatar Sep 01 '22 05:09 Phantomxm2021

This is a bug. Good catch.

For now you can work around the issue by querying whether or not the CameraData.xrRendering property is true when URP is enabled.

DavidMohrhardt avatar Sep 20 '22 22:09 DavidMohrhardt

This is a bug. Good catch.

For now you can work around the issue by querying whether or not the CameraData.xrRendering property is true when URP is enabled.

Thank you for your reply. But How can I accessing the CameraData ?

Phantomxm2021 avatar Sep 22 '22 02:09 Phantomxm2021

So, looking into this, can you clarify what you mean by "doesn't work", is it a compile error, a runtime error, or does it not output correct values when querying?

WyattBUnity avatar Mar 30 '23 19:03 WyattBUnity

So, looking into this, can you clarify what you mean by "doesn't work", is it a compile error, a runtime error, or does it not output correct values when querying?

Incorrect values when querying!

In URP m_CameraAR.stereoEnabled always return False .

Phantomxm2021 avatar Apr 01 '23 04:04 Phantomxm2021

Got it, I tested it on a project with later versions of unity, and I was able to get it to output true and false when using URP in VR and out of VR. Can you give me the unity editor version, arfoundation package version (check the package manager page) and what device are you trying to use with it?

WyattBUnity avatar Apr 03 '23 20:04 WyattBUnity

Got it, I tested it on a project with later versions of unity, and I was able to get it to output true and false when using URP in VR and out of VR. Can you give me the unity editor version, arfoundation package version (check the package manager page) and what device are you trying to use with it?

Unity Version:2021.3.21f ARFoundation Version: 5.0.3 Device: mobile

Phantomxm2021 avatar Apr 07 '23 04:04 Phantomxm2021

Device: mobile

As in VR on the mobile device itself that requires it be placed in a headset chassis?

WyattBUnity avatar Apr 07 '23 17:04 WyattBUnity

Device: mobile

As in VR on the mobile device itself that requires it be placed in a headset chassis?

No! ARFoundation is for AR not VR. When we use the mobile(iPhone -ARkit / Android - ARCore) to use ARFoundation 5.x version in URP, we need to use m_CameraAR.stereoEnabled to disable the CheckRenderLine.

Phantomxm2021 avatar Apr 08 '23 02:04 Phantomxm2021

I'm interested to know the situation that the camera will be rendering stereo while using the ar foundation package that's on a mobile device, without it being vr. If the stereoEnabled is always false, then you have confirmed that it returns false while it's rendering stereo vision on a mobile device as you stated, the details of the setup is what we need to know in order to reproduce the issue. Or, if possible, it would be helpful for us to have a project that is reproducing the issue with defined steps, in the case that it's too complicated to explain precisely how to get the bug to occur.

WyattBUnity avatar Apr 10 '23 16:04 WyattBUnity

If the device is not being used to render a stereo VR image (IE you are not in a multipass or single pass instanced stereo rendering mode) then m_CameraAR.stereoEnabled always returning false is the correct behavior.

DavidMohrhardt avatar Apr 12 '23 18:04 DavidMohrhardt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 18 '23 10:06 stale[bot]

Closing this issue as asked and answered. Thanks @DavidMohrhardt! Feel free to re-open it if you have further questions.

andyb-unity avatar Sep 28 '23 20:09 andyb-unity