URP lit shader will not receive shadows while transparency is enabled

I’ve noticed that the LWRP/URP lit shader (or any other URP shader) will not receive shadows while the transparency is enabled. Is there a workaround for this? Or maybe some kind of shadow catcher material? Maybe I should go back to the default RP and try its mobile shaders.

Hey Centripetal,
This was a bug but has been fixed and will be in the next release of URP.

Here’s a link to the PR
https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4979

Thanks for the information.

Hi, got URP 7.1.8 released 22.January. Where can i find the toggle that is mentioned in the github comments?

Hey,
7.1.8 was a minor update to URP and the changes made in my PR were quite significant so this fix was unfortunately not able to be part of that update.

It will however be in the 7.2 version that’s due to release in approx 2 weeks.

1 Like

@Elvar_Orn Do you have a link to the ticket for this issue?
I’m working on a project that will need shadows on a transparent surfaces using the URP.

Sorry, I just noticed your link in your previous post.

@Elvar_Orn I’m now with URP 7.2.1. Do shadows still not work on Lit shader with Surface Type: Transparency? I have “Receive Shadows” checked.

@GVUnity were you able to see shadows?

If you look in FrameDebugger, can you see a pass that is rendering objects to a shadowmap? (before opaques).
Do you have “transparents receive shadows” in the renderer asset? It is enabled by default.
Is you light set to realtime and it has “cast shadows” option enabled?
Do you have realtime shadows option enabled in your pipeline asset?

Having the same issue as above with 2019.3.4f1 & URP 7.2.1, no shadows on lit transparent shaded objects.

Simple scene with a stack of objects in Y

spot light shining down Y at the top
cube
transparent plane
opaque plane at the bottom

Shadow on the opaque bottom plane of the cube, but nothing on the transparent plane at all.

In answer to the questions below

In the frame debugger, yes I do see a pass rendering to a shadow map, can see the shadow on the opaque plane at the bottom of the stack but nothing on the transparent plane

I do have “transparents receive shadows” turned on, on the material

My spot light is set to realtime

Light does not seem to have a “cast shadows” option, however given I am seeing my soft shadows on the bottom opaque plane, Im going to assume this is correctly setup.

Similarly cant see a “realtime shadows” option in the pipeline asset, there are options for “Cast Shadows” which are turned on, and again I am seeing shadows on the opaque plane.

Am I missing something silly?

1 Like

2019.3.7f1 URP 7.3.1 still not working properly.

1 Like

I am using URP 7.2.1 and, you guessed it, for me the “Transparent Receive Shadows” is also not working

… for the STANDARD URP materials. However, I noticed that my shader graph material works just fine. Threw that sunofa on my other objects and sure enough my transparent objects had shadows.

It is, of course, annoying and unintuitive to recreate (and test!) a couple of different shaders, but I hope this at least helps anyone who finds this thread.

UPDATE:
In fact, here is a recreation of the Simple Lit shader to get you started.

5687197–593623–SimpleLitTransparentGraph.zip (5.21 KB)

1 Like

Is this issue still going on ? I cannot use URP at all if this simple base feature is not working

It should work, when this issue was fixed in 7.2.0, I created a test scene containing every URP shader opaque and transparent and all of them receive shadows.

If this is not working then that is some bug I haven’t been able to reproduce and would love to receive a bug report about it.

Hi, thanks for the response.

Is there a way to get an insight of what the fix was ? I have a shader based on URP Lit one, i started it on LWRP 6.9.0, and did some changes as moved to URP. Now i am not sure if is the fault of my shader based on older LWRP or new URP issue. Turning from transparent to AlphaTest works for shadow receive.

Also is there any news about the slowdowns in Unity editor after Unity 2019.3.1f1, i have sent this bug long time ago and there is no news, this is also crucial for my asset and currently is not working at all after Unity 2019.3.1.

https://fogbugz.unity3d.com/default.asp?1233944_744uepe09a7cbra7

Thanks in advance

Shadow receiving is unified and now resolved together with lighting as opposed to be resolved in a screen space texture before lighting.
There is a guide on how to do this for custom shaders here in the section Sampling shadows for MainLight: Upgrading to version 7.2.0 of the Universal Render Pipeline | Universal RP | 7.2.1

1 Like

Thanks a lot, i will try that.

We updated our project from LWRP to URP and are seeing similar issues. Any chance switching between the two could cause the problem? It’s happening with shader graph shaders, as well as built-in Universal shaders like unlit particles. Toggling transparents receive shadows has no effect.

Hi, not sure if it’s the same issue, but the terrain does not receive shadow at all while using the default terrain shader (URP/Terrain/Lit). The shadow works fine if I switch the shader to hidden shader Hidden/Universal_TerrainVisualization, which I came across trying different shaders.

The problem is that I can’t add layers on the Hidden/Universal_TerrainVisualization. I tried manually updating the default shader to mimic the hidden shader without success.

Any advice how to make the default TerrainLit shader receiving shadow?

1 Like

Any luck solving the problem? I still have no shadows casting from transparent objects, they get painted as soon as I switch the material to opaque.

1 Like

In URP 7.3.1 when using Lit shader and transparent mode doesn’t seems to cast shadow. I don’t understand how hard can it be to fix this issue… This thread is almost 1 YEAR old…

1 Like