Is there a built in shader to have lit sprites in URP?

I’m trying to have some 2D sprites lit by some 3D lights I have on my scene. I used to do that without problem with older Unity versions, before URP. But now in Unity 2020 and URP the older shaders don’t work anymore. I’ve tried all the built in “lit” shaders, but none of them render sprites properly. The lit shader inside the 2D folder renders the sprites correctly but won’t react to 3D lights. What shader should I use?

This is weird. I think I already used the regular lit materials on sprites. I don’t want to say this but this seams like a bug to me. There is decorator in the URP lit / unlit shaders “[MainTexture]” that explicitly exists to solve this issue.

Anyway, solution: Create THE most simple shadergraph lit shader, with a texture, call it MainTex (or rather its reference should be name _MainTex. Connect that to the base color output and it should work.

Actually take this shadergraph ^^
Note that I did not setup normal maps.


7235882–871124–SpriteLitBasic.unitypackage (5.36 KB)

Ok, I tried this approach several times, following several youtube tutorials, and it didn’t work at all. Now I import your shader and it seems to be working perfectly. I was clearly doing something wrong but I can’t identify what.
Anyway, thank you very much @fleity , you have my eternal gratitude.

1 Like