Hi there, enjoying the light engine. Is it possible to block a shadow in one direction but show it in another. ie. I'm simulating a sudden drop in an overhead game I want shadows cast over the drop but not the other way. Thanks :)
Viewing post in Eclipse Light Engine comments
I'm not sure what you mean by that. The shadows cast according to light source position and light type determines how its lit.
Using the light depth and shadow depth you can affect some things like that, or another shadow caster blocking.
You'll have to explain in more detail, since there is no way to select a single shadow like that. Its similar to a 3D game's shadows.
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.