URP - No shadows from Spotlight

Another week, another problem to decipher. This is fun.

This time, no matter how many different tutorials I follow, I cannot get the spotlight to cause a shadow on anything in real-time.

You would think it would be easy but apparently no matter what I tweak and no matter how much I dumb down the complexity of the scene, nothing works. Please help, I’m pulling out my hair as it’s supposedly a simple task (which I have done quite easily in the past) but on a URP-native project nothing works; pre or post-processing.

See pic. You would think the spotlight would cause the cube to cast a shadow? No no no that would be tooooo easy.

The cube is clearly shown as lit-up by the spotlight.

Settings you ask? (Note, all settings are tweaked to the moon and back as I was trying to find any indication that they were impacting on my lack of shadow.)

Baked lightmap? Turned it alllll off (and cleared the data) because I thought that was the cause.

Shadow quality? High and ‘Distance Shadow Mask’.

Mesh renderer? Shadows on.

In fact anywhere there is the term ‘shadows’, I have on.

I legit just don’t know what else Unity wants from me?! It’s another thing I’ll add to my list of things that should, 100%, be the most basic of tasks; yet it has turned into a 2-day rabbit-hole of 1000 Chrome tabs opened trying to resolve said ‘basic’ task.

Unity version 2020.3.5f1, URP project.

(As a fun fact, I changed from a non-URP project to a native, as the URP was bugging out with JSON errors and it took me weeks to figure out the underlying cause).

Please help, it would be greatly appreciated.

1 Like

For future answer-seekers:

This Reddit post solved the problem for me: in your URP asset (which should be referenced in your project settings under Graphics-> Scriptable Render Pipeline Asset), In the Lighting section, under Additional Lights, there is a field called Cast Shadows. Check that checkbox and see if your problem is solved!

For those playing at home, I found that a poorly-documented URP was the reason behind it.

Honestly, the “documentation” and “tutorials” on the URP is disgustingly shallow and provides little-to-no help with regards to real-world usage.

Good-luck if you’re using one.

Here are my settings to get shadows working in URP with a Spotlight and with the Oculus Quest:

I had a similar problem. The reason was that I set the “Range” property of the spotlight to a very high number. Lowering it something more sensible fixed the issue, the shadows a properly rendered now.