• 2D
  • Multiple shadows with increasing transparency

I use one big, totally white image for the light and canvas modulate to make some contrast:

What I'm aiming for is to have some softer shadows, or maybe the better word is shorter, like gradient. Here's a bad interpretation of what I mean:

I could use that big white image and draw white-to-transparent gradient for each shadow I have, but there are moving parts on the level, so I cant really do that.

Is there a way to implement gradient-like moving shadows?

Couldnt you just change the light texture to already have an alpha gradient? I think that way you should get your desired effect.

@vinpogo said: Couldnt you just change the light texture to already have an alpha gradient? I think that way you should get your desired effect.

If I did that, the more an object is closer to the light source its shadow would show more, and further away it is the gradient would be less visible. What I'm trying to achieve is the sun effect, like a light that's infinitely far away and the light is equally hitting the ground everywhere.

so if i understand correctly you dont want any object to cast a shadow on the floor, but only in the air. If thats the case i think it will be very hard to achieve. Actually i would question that behaviour, as also the sun cast shadow on the ground. But in case you need that behaviour id actually realize the shadow with a simple sprite. and in case the object is too close to the ground you can scale it in the y direction

@vinpogo said: so if i understand correctly you dont want any object to cast a shadow on the floor, but only in the air. If thats the case i think it will be very hard to achieve.

No no, I want the shadow to interact with the ground, it's just that I clumsily drew this.

but then i dont really understand what you want to achieve. Have you tried out my first suggestion? Regarding your concern that object closer to the 'sun' would cast a more intense shadow, i think this is unavoidable. At least i dont have any ideas....

@vinpogo said: but then i dont really understand what you want to achieve. Have you tried out my first suggestion? Regarding your concern that object closer to the 'sun' would cast a more intense shadow, i think this is unavoidable. At least i dont have any ideas....

Please read what I've wrote again. I believe I've managed to explain it well. Here's another, a bit more detailed drawing: Notice how shadows are lighter when closer to the 'sun' and darker when further away from it. I've exaggerated it here so you can understand what I'm aiming for better.

@LuckyB45tard said:

now im really confused, as the sketch you drew initially is the opposite of what you have drawn now, in terms of where the dark parts of the shadow are. Im sorry i couldnt help... hopefully someone else has a solution