Hello,
I build this shader for shadow creation purposes. I would like to get it drawn from top to bottom of the texture.
But during the love.graphics.draw() the strite is getting rotated and so the shader result :/
Could you help me to resolve this problem, please?
I would like with any rotated love.graphics.draw() call, a shadow being driven from top to bottom independent from any angle.
Well yeah you use texture coordinate Y and you sample by texture coordinate Y (and X), so of course each part of the sprite will be shaded the same way regardless of orientation, position, scaling, etc. You need to compensate against the graphical transformation inside the shader to get it to work this way. But you can probably get away with using screen coordinates, which are not transformed. Keep in mind though that screen coordinates are in pixels instead of percent.