How do i shade underground tiles like in Terraria

How do i make underground tiles darker like in Terraria?


So that they get darker the more tiles surround it, because less light gets to it.

I am using 2d lights btw.
I tried Light2D but it only gave errors (probably because im using the 2d lights).

Late to the party, but here’s an example on GitHub: GitHub - BigDaddyGameDev/Tile-Light-and-Shadows-Like-Terraria: An example of how to drawing Terraria style block lighting and shadows.

It uses a two cameras to get a buffered blend. One camera takes an image of areas with no blocks, applies a gaussian blur and blends the image with the other camera.