Forum Discussion
ThoughtfishConny
3 years agoPartner
Transparent Materials render Passthrough through them even though solid object is behind them
Hello!
I am using URP, Unity 2021.3.14, OpenXR Plug-In and Passthrough. Any transparent materials will have Passthrough (on Underlay) shine through, even if it should be blocked by a solid object. It makes everything transparent look grey because of the Passthrough Not using any transparency is not really an option for me. Did anyone encounter this issue and/or has a solution for it?
8 Replies
Replies have been turned off for this discussion
- ShivekXRExplorer
I have a similar problem to yours. Commenting and thumbs up for the visibility.
https://communityforums.atmeta.com/t5/Unity-VR-Development/Bug-report-Half-transparent-materials-leak-Passthrough-layer/m-p/1061269#M22217 - israelz74Explorer
Hi
Any solution?
Thanks
- RaptorMattExpert Protege
I am having the same problem. Is there any solution to this? I'm using Unity URP, with Unity version 2022.3.10f1
- BogomilPetrovProtege
Could you try opening the shader and where it says ZWrite set it to on instead of off?
- BogomilPetrovProtege
Hey. I had a similar issue when using the Selective Passthrough shader.
I fixed my problem by opening the shader code and setting Z Write to on. I found that when it was off none of my transparent materials rendered over the passthrough at all.
- RaptorMattExpert Protege
Hmm, thank you for the suggestion BogomilPetrov - that is good to know for Selective Passthrough but unfortunately that doesn't seem to help with Background Passthrough. ☹️ I went through all the Meta-provided passthrough shaders and made sure ZWrite was set to 'On', but got the same result. I also turned on ZWrite for my own UI shader (it's a custom UI overlay shader) but that didn't do anything to help either. Any UI that has transparency has passthrough rendered through it, regardless of whether or not there is an opaque object behind the UI. ☹️
- RaptorMattExpert Protege
I should note that this bug also exists with Meta's own shaders/materials. For example, the "stylized hand" shader (the "OculusHand" material) included with the SDK suffers from this issue. If you have a passthrough scene with a solid 3D model, and you hold your semi-transparent "stylized hand" on top of the 3D model, you'll see passthrough rendered through the semi-transparent hands even though there is a solid 3D model behind the hands.
- RaptorMattExpert Protege
Per the suggestion of markeahogan, setting the blend mode to
Blend SrcAlpha OneMinusSrcAlpha, OneMinusDstAlpha Onefixed the passthrough transparent rendering bug for my own transparent materials. If the issue still exists for any default Unity transparent materials though, then Meta should see what they can do to fix it, or at the very least write some documentation about the problem. I had to duplicate and modify their 'OculusHand' shader in order to edit the blend mode and properly render their 'stylized hand' models with no passthrough rendering bug.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 11 months ago