I'm trying to implement a tilemap for top down game with different height levels. It is also required to display the light correctly:
Light2D must affect only cells located on the same or lower levels. And it must also produce shadow from the cells of the next higher level. My current solution uses multiple layers of
TileMap's with different
occluder_light_mask values. Each
TileMap represents corresponding height level. Border cells have a square occluder. This works when there are only 2 levels but with 3 and more levels I face the issue that can be seen on the following screenshot:
As you can see there are 3 height levels and the hero with its flashlight is on the 2nd "floor". The problem is that shadows from the 3rd floor cells aren't shown on the 1st floor. I've experimented with
TileMap's and occluders and it seems that shadows aren't drawn on empty cells (pretty obvious). And in my case those cells representing the 1st floor are empty for other 2
TileMap's. This is the cause of the issue. So, can you please give me an idea of how I can overcome this limitations?
P.S. Sorry for my english.