Firstly, what a great light lib! some incredible bits in here.
Quick question:
The light will hit a shape, and cast a shadow behind it, but if there is a shape behind that shape (and thus in the shadow) it gets drawn as if the light was hitting it - what is the best way around this..?
As in, I would like the shape behind the other shape to be in darkness.
zell2002 wrote:The light will hit a shape, and cast a shadow behind it, but if there is a shape behind that shape (and thus in the shadow) it gets drawn as if the light was hitting it - what is the best way around this..?
See the completely reworked fork of this engine called Light vs. Shadow v2 (or light_world, or LightWorld, I'm not 100% sure, I've seen it referred to in all those ways xD): https://www.love2d.org/forums/viewtopic.php?f=5&t=78998
I'm not exactly sure how it compares in all aspects, but I do know it is more developed, and does the thing you are asking about.
Although, it still does the lighting the wall from the other side - havent had a chance to look through yet
but, is it something i'm meant to activate/generate a specific light type?
zell2002 wrote:Although, it still does the lighting the wall from the other side - havent had a chance to look through yet
but, is it something i'm meant to activate/generate a specific light type?
I'm a bit confused what you mean. You have to create lights or else there are no shadows.
Also, I must have misunderstood your original problem, because I can assure you, the engine I linked to does not have that problem. Perhaps if you could show an example of the code you are using and what you are expecting, I can understand better and attempt to help out. Also, you should post that in the other thread, since that is what we are talking about at this point (and it is more current than this).
The issue (if it is an issue) I see you can create using this or his project and spinning up the "complex" level. Left click and add a bunch of shapes then move the light around. The shapes light up even if one is behind the other, as if the light is above them shining down, rather than on the same level and shinning then hitting a wall... is this correct behavior for the lib though?