I have a game I am trying to set up for 2D lighting with the Universal Render Pipeline. I am also using the Super Tilemap Editor asset from the asset store. I followed this tutorial to try and get started with 2D lighting:
I’m using Unity 2019.4.33f1 LTS.
I followed his instructions:
-
Import the Universal Render Pipeline package
-
Create > Rendering > Universal Pipeline > Pipeline Asset (Forward Renderer)
-
Create > Rendering > Universal Pipeline > 2D Renderer
-
Drag the 2D renderer onto the Renderer List of the new Universal Pipeline asset
-
Edit > Project Settings > Graphics > Change the render pipeline asset
-
Edit > Render Pipeline > Universal Render Pipeline > 2D Renderer > Upgrade Scene to 2D Renderer
Initially only some things went black, most still looked like regular “unlit” sprites, ie, not affected by lighting. I realised it’s because they were using a sprite shader that was unaffected by lighting, so I made a new material that uses the default UDR 2d Sprite Lit default.
So, if I drag a new sprite onto the scene, it uses that material by default, and is black and fine. When I updated the material in my Super Tilemap Renderers, I have mixed results. Some of the tilemaps go all black, some are unaffected. Picture example.
List of tilemaps in the heirarchy
Tilemap renderer with correct material
Result
I added a point light over where there should be water, and you can see a soft circle of water fading into shadow where the point light is.
But all of the palm trees outside of that, as well as the waterfalls, the sand and rocks, etc, should be black, they are not lit. At first I thought it’s because I pained some as prefabs, and made sure to go into every individual prefab (the waterfalls are all prefabs) but it made no difference. Likewise, the trees are not prefabs.
The only pattern I can see is, the top tilemap in my heirarchy is behaving properly, the rest are not. Base is where the water is, and that entire layer, which is using both prefabs and non prefabs for the tiles, the whole tilemap is behaving properly with the light. None of the other tilemaps are.