I just installed Universal Render Pipeline (10.5.1) into my Unity (2020.3.15f2) 2D project and believe I have everything configured correctly.
- I created a new RenderPipeline asset
- I deleted the default Renderer on it and added a new 2D Renderer
- I added the RenderPipeline into the Graphics section of my Project Settings
- I changed all my sprite materials from
Sprite-DefaulttoSprite-Lit-Default
Here is how everything is set up:
In fact, I can see results in my scene when I add lights to my objects. For example, here I have a PointLight2D set to a SortingLayer called "Enemy". You can see that it properly lights the enemy sprite which is also set to that SortingLayer.
The problem is that even with no other lights in the scene, if you toggle the PointLight2D TargetSortingLayers to "None" (or simply some other SortingLayer that doesn't include "Enemy"), the enemy sprite in the scene still appears fully lit, which seems very odd. For example,
If, on the other hand, you simply disable the light, you see fully unlit sprites, which is what you'd expect.
So my question is why does setting a light's TargetSortingLayers to "None" (or simply a different layer than your sprite) not result in a fully unlit sprite, but rather a fully lit sprite?
I am wondering whether this is intentional behavior that I don't understand, or possibly a bug in URP.
This behavior is reproducible in a brand new 2D project that you download the Universal Render Pipeline into, with both PointLight and GlobalLight (haven't tried other types of lights).
Related questions from elsewhere on the web, with no resolution:




