Jump to content

XR Elite PassThrough Problem


Ring

Recommended Posts

I want to enable passthrough mode on XR Elite through Unity, but no matter what I try, I only see a black screen.

I'm pretty sure that I have set the camera's background solid color to black (0,0,0,0).

And here are my code.

image.png.6e1679ba80a14b81b0dc21f2080a4d1d.png

Is there any detail that I might have missed? I'm really going crazy.

I would be grateful if someone could provide me with some help.

Link to comment
Share on other sites

Hi @Ring,

For myself, I will do the followings,

private Color? recOriginalColor = null;

//In your show passthrough underlay function, add below code before calling Interop API
Camera.main.clearFlags = CameraClearFlags.SolidColor;

if (recOriginalColor == null)
    recOriginalColor = Camera.main.backgroundColor;

Camera.main.backgroundColor = Color.white * 0;

//In your hide passthrough underlay function, add below code before calling Interop API
Camera.main.clearFlags = CameraClearFlags.Skybox;

if (recOriginalColor.HasValue)
    Camera.main.backgroundColor = recOriginalColor.Value;
else
    Camera.main.backgroundColor = new Color(49f / 255f, 77f / 255f, 121f / 255f, 5f / 255f);

 

Let me know if you still have issues.

  • Thanks 1
Link to comment
Share on other sites

Hi, @chengnay,

Thank you for your code. It works for passthrough, but in my case, the virtual object disappears.

Besides that, I tried creating a new Unity project and copying the scene over to the new project, and everything worked fine. So it seems that there was something wrong with the original project that caused passthrough to not work properly.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...