Help with 2D lighting and tilemaps - UDR not working as expected

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.

9208329--1284906--upload_2023-8-11_0-39-41.png
List of tilemaps in the heirarchy

9208329--1284909--upload_2023-8-11_0-39-57.png
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.

9208329--1284915--upload_2023-8-11_0-43-6.png

I just did an experiment and turned off all my tilemaps in the scene. I then made a new tilemap. It behaved properly with the light. I then made a second tilemap. It did not behave properly with the light. There really does seem to be a limit of 1 tilemap only working with a light source at the moment.

I also got this error when upgrading the super tilemap editor, not sure if it’s relavant: 9209436--1285191--upload_2023-8-11_12-18-58.png

try without using the 3rd party asset

also what it looks like is that the parts that are not black dont have the same material

Thanks for your reply. So, the material on all of them is the same. I did make a brand new material to make sure that wasn’t causing issues (initially it was), but now they are all using the same material and that didn’t fix it. It seems like the top tilemap works, and not the others, which makes me think it could be either a bug, or I’ve set their tilemap up wrong.

You’re right though. I’ve started experimenting with Unity’s own tilemap system, and saw that it’s finally added a lot of the features it was originally missing, like painting prefabs, random brushes, etc, so that might be worth a go.

However, I am still having another weird issue with rendering in the scene view, which I have no idea what has caused it, but I suspect it’s a setting, and may be because I upgraded this project from an older version of Unity, I’m not sure. That post is here: https://discussions.unity.com/t/926029