I would love if one could simply add some shadow caster component to a tilemap with a TilemapCollider2D or CompositeCollider2D, and than that collider gets already recognized for the shadow generation
with this:
you can generate shadow casters for all open tilemaps in scene that have CompositeCollider2D using a button in the UI
that works aswell but is a bit less intuitive then simply marking the shadow casting objects and have anything beyond that automatic
something I noticed when setting up a top down scene with 2D shadows, is that certain objects are not really supposed to cast shadows in every direction…
and different objects should have a different shadow length
for instance for a cliff wall, shadows should act differently whether the light is on top of the cliff, or below
here a quick example:
Light below cliff:
light above cliff:
for the first image, it is fine that everything above the cliff is shadowed, since the light would not reach there with the source being below
for the second image, it would be nicer if the rocks either dont cast a shadow at all, or one that has a smaller length, as in only the area close to the rocks being shadowed
I really dont know how something like this would be best presented to the user, since the shadow direction and length would need to be part of the tile info, generating a shadow caster from collider alone would no longer be enough…
maybe this info could be defined in Rule Tiles, with each rule having an advanced definition option to declare which direction casts which length of shadows?
beyond that, just shadow length in general would be appreciated, makes no sense for a tree and a bush to have shadows of the same length (while right now, I think every 2D shadow caster always has an infinite length)