Hi Janbo, I've been playing around with your excellent 2D Normal Mapping code from this thread:
https://forum.thegamecreators.com/thread/212611 (now locked)
However my shader knowledge/maths aren't good
Attached are a couple of gifs I hope show the problems. I draw a square at the screen co-ords of the light, and a circle for the range.
Two questions:
1. Can you tell me how to 'point' the light straight into the screen, so that its a spot rather than a cone? see light_angle.gif - it looks pointed down and left.
2. When I resize the app window or make it full screen, the normal light moves further away from the xy coords - possibly due to 'uniform vec2 agk_resolution' changing. Is there a way I can compensate for this?
Ultimately I'd like to show the light, as a circle, at the mouse coordinates - regardless of the screen size.
The attached shader should be the same as your original, I don't think I hacked it around too much...