cancel
Showing results for 
Search instead for 
Did you mean: 

Passthrough with Shadow

raeldor
Expert Protege

I'm trying to get shadow cast against the passthrough image.  I have a transparent shadow shader (attached to an invisible floor plane) that works fine against a UI Canvas/Image in 'Screen Space - Camera' (see screenshot).  When I remove that UI image though, I was expecting it to render that shadow over the passthrough image on the headset, since the passthrough image is at the back.  However, no shadow gets rendered.

 

Has anyone done this sucessfully?

 

raeldor_0-1667476291158.png

 

18 REPLIES 18

I am doing something very similar.  That may work well for a smart phone AR experience, but it seems Oculus passthrough is completely blatting out EVERYTHING if it thinks the 3D object is transparent; regardless of whether that object has shadows rendered to it or not.

Double check your unity quality settings and make sure shadows are on for the android device. Are you using URP or standard render?

I will check that out, thank you.  I'm using the standard renderer.  Should I be using the URP?

NP. It should be possible in either version but depending on which your using the solution could differ. The sample Tut uses URP. 

raeldor
Expert Protege

So, I updated to URP.  My custom shader no longer works, so I used the UDP/Lit shader.  However, using this shader I can't seem to get a solid shadow on a completely transparent object, so I used the shader from the YouTube video.  That seems to work fine, but again, as soon as I run it in Oculus it just loses that shadow even though it works in the play window.

 

I think this may be all about which material Oculus are using to render the passthrough.  To get it to work using a UI image as the background, I had to set the material to use Render Queue 'Geometry' (3000) instead of the default (From Shader, 2000).  There seems to be no Render Queue option for Passthrough though.

mreimer
Expert Protege

Double check that your Android quality settings have cast shadows enabled. 

 

mreimer_0-1667491735683.png

 

It definitely does, because if I make that invisible plane visible the shadows show up immediately.

raeldor
Expert Protege

Has anyone successfully got shadow working using OVR Passthrough Layer?