Ring Posted May 9, 2023 Share Posted May 9, 2023 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. 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 More sharing options...
Ring Posted May 9, 2023 Author Share Posted May 9, 2023 By the way, I'm using Unity 2020.3.40 URP Link to comment Share on other sites More sharing options...
MarcusN Posted May 9, 2023 Share Posted May 9, 2023 Hi @Ring, Have you tried referencing this link for Passthrough and seeing if it helps resolve your issue? https://hub.vive.com/storage/docs/en-us/UnityXR/UnityXRPassthrough.html?highlight=passthrough Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted May 10, 2023 Share Posted May 10, 2023 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. 1 Link to comment Share on other sites More sharing options...
Ring Posted May 10, 2023 Author Share Posted May 10, 2023 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. 1 Link to comment Share on other sites More sharing options...
Alex_HTC Posted May 10, 2023 Share Posted May 10, 2023 @Ring Based on your description, I suspect that some example code that calls PassthroughOverlay is running in your previous scene. Look for example monobehaviours (like our passthrough example code) that may be calling that by default. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now