Skip to content

2D Renderer URP Lights

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 demo scenes that 2DRendererDemo.unitypackage installs in the 2DRenderer 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:

The All In 1 Shader component with Change Shader Variant set to Urp 2d Renderer, and the Create And Add Normal Map button below it

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 Asset Shader on the Others tab of the asset window (Tools → AllIn1 → Sprite Shader Window):

The Others tab of the Sprite Shader Window, with the Default Asset Shader dropdown

You can add a normal map that affects how the sprite is lit in the Material Inspector:

The Lighting Properties section of the Material Inspector, with an arrow pointing at the Normal Map texture slot below Lighting Mult

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:

  1. When the Urp 2D Renderer shader variant is being used you can automatically create and add the normal map to the sprite by pressing the Create And Add Normal Map button, under the variant dropdown in the component image above.

  2. 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):

    The Texture Creators tab of the Sprite Shader Window, which starts with the Normal/Distortion Map Creator

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:

A Light 2D component in the Inspector, with an arrow pointing at its Use Normal Map checkbox, ticked

The Lit variant has a Glow affects light toggle, on by default. With it on, the parts of the sprite brighter than white, such as a Glow, keep that brightness instead of being darkened by the 2D lights, so a glowing sprite still glows in a dark scene.

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:

The Scene view's effects dropdown with Post Processings unticked, which hides the Bloom flicker in the Scene view