What I mean is, if the left half of the room was 100 metres lower than the right half and there was a cliff in the middle, how would I project a shadow over the drop if the sun was in the east but no shadow if in the west. Sorry, not good at explaining myself! 🤪
I think I get it.
You will want to set the light depth and shadow depth:
The value is normalized from 0 to 1 which lets you setup your own values based on whatever depth you use for your layers/objects. A value of 1 is closest to the top and 0 is the bottom. So, you could lerp() between your maximum and minimum layer depth values for your lights and shadow casters.
I’ve had a fiddle but can’t seem to get one object to cancel the shadow of another. I’ve set the blocker object to a higher depth than the other and changed the shadow depth and light depth but can’t get the effect I want. Any ideas?
In this example I’m simulating the fact that the dark grey tile is a very tall tower block so should absorb the cars shadow.
Why would the shadow not cast "north" if the sun was in the "south"?
The track that is above would be a shadow caster with a higher shadow depth than the track below it. The sun would also have a depth, but light depth, which would be higher than the top (or equal since it uses >=).
Sun is light depth 1.0
Top track is shadow depth 0.9
Bottom track is shadow depth 0.8
The shadow would then cast correctly. The only thing you can't really do is have it cast as if the track below has any slope to it since there is no 3D model to work with, i.e., it has a constant shadow depth in a plane.
The top track would be on a different layer than the bottom track, and cars would be on layers right above each. At the right places on the track those cars would switch layers as well. They should switch their shadow depth to match the part of track they are on.