Skip to main content
New Participant
June 20, 2023

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?

This topic has been closed for replies.

8 replies

ShivekXR
New Participant
June 24, 2023
Participant
September 5, 2023

Hi

 

Any solution?

Thanks

RaptorMatt
Inspiring
November 3, 2023

I am having the same problem. Is there any solution to this? I'm using Unity URP, with Unity version 2022.3.10f1

Participant
November 12, 2023

Could you try opening the shader and where it says ZWrite set it to on instead of off?

Participant
November 12, 2023

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.

RaptorMatt
Inspiring
November 13, 2023

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. ☹️

RaptorMatt
Inspiring
November 14, 2023

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.

RaptorMatt
Inspiring
November 14, 2023

Per the suggestion of markeahogan, setting the blend mode to

 

 

Blend SrcAlpha OneMinusSrcAlpha, OneMinusDstAlpha One

 

 

fixed 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.