2D Renderer URP Lights
Last updated
Last updated
In order to get access to these features please follow the steps mentioned in the Render Pipeline And Post Processing Setup section of this Documentation.
And here you can find a video showcasing this new feature:
The best way of seeing what you can do with these features is to take a look at the URP demo scenes inside the URP folder. In particular the DemoLighting one.
If you want to assign a Urp 2D Renderer shader to any particular sprite the easiest way to do so is by adding the asset component asset and changing the shader variant:
If most of the assets you use will use this variant and you don’t want to manually change the shader variant every time you can change the default shader variant in the asset window (Window -> AllIn1ShaderWindow):
You can add a normal map that affects how the sprite is lit in the Material Inspector:
You can create the Normal Map externally or you can use a normal map creator included in the tool. You can use these 2 methods:
When the Urp 2D Renderer shader variant is being used you can automatically create and add the normal map to the sprite but pressing the Create And Add Normal Map button:
You can also use the asset Window to use this feature without needing a sprite+material+asset component combo (more info about this feature in the Asset Window section):
Keep in mind that the normal maps will only be taken into account if the Use Normal Map checkbox of the 2D Light is set to true:
To end this section I’d like to mention a very annoying problem/bug that exists with the URP Volumes post processing Bloom and the 2D Renderer in the Scene view (everything works perfectly fine in the Game view and in the final build). If you have Bloom active you may get very annoying crazy flickering colors when you move the Scene camera. I haven’t found any solution and I hope that Unity fixes it soon. For now the best solution is to disable Post Processing in the scene tab: