LocalJoost / MRTKQuestSeeThrough

MIT License
4 stars 4 forks source link

How to solve the passthrough problem? #2

Open nongzhang opened 1 year ago

nongzhang commented 1 year ago

I suspect MRTK2.8 and Oculus Intergration don't work well together. My scene is a cylindrical courtyard model with the camera and UI panel in it. I want to switch between passthrough mode and non-passthrough mode. when use Underlay, click a button, hide the cylindrical model,the outside is black,not reality background. when use Overlay and set Opacity 0.3, there is a slight passthrough effect In the courtyard model, this is not i wanted, i need absolute VR experience.Is there any way to solve this? Maybe should use MRTK 3? And when changing overlayType or textureOpacity in code, it doesn't work.

public void SetPassthroughOrNot()
    {
        if (environment.activeSelf)
        {
            passthroughLayer.overlayType = OVROverlay.OverlayType.Overlay;
            passthroughLayer.textureOpacity = 0.3f;
            environment.SetActive(false);
        }
        else
        {
            passthroughLayer.overlayType = OVROverlay.OverlayType.Underlay;
            passthroughLayer.textureOpacity = 1.0f;
            environment.SetActive(true);
        }
    }
LocalJoost commented 1 year ago

MRTK3 might be a good idea. Do these help? https://localjoost.github.io/Full-underlay-passthrough-transparency-with-MRTK3-on-Quest-2Pro/ https://localjoost.github.io/Full-underlay-passthrough-transparency-with-MRTK3-GA-on-Quest-2Pro/