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.
Answer by Phorj · Aug 22, 2021 at 05:28 AM
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.
@Phorj Could you share with us what you did to get shadows working other than chastising Unity's documentation? I'm having the exact same issue.
My apologies all for not putting in my fix. Super frustrated and didn't come back to it.
Long story short, it had to do with my camera perspective and the range at which the shadows were being shown to the camera.
Your answer
Follow this Question
Related Questions
Shadow rendering distance HTML5 1 Answer
Shadows not the same in editor game tap, and the game build! Bug? 0 Answers
Lights and shadows flickering extremely 1 Answer
Using multiple cameras for different render distances causes weird shadow effect? 0 Answers
[URP] Transp Shadergraph has shadows? 2 Answers