I'm playing around with shaders for the first time and though it's challenging it's a lot of fun.
I'm creating a 2D platformer, where the setting is a cave so I thought it would be neat to have the lightning only just around the player.
However, I'm having a problem where this eclipse of light simply outruns the player as the map starts scrolling (look at the GIF): I have no clue why this is. I'm using a variable called playPosition that simply tracks the position of the player on the x-axis.
It's almost all in my main.lua which I have enclosed as well if you want to take a look. The shader-code is in the top while the shader is being drawn in love.draw.
I really hope one of you is able to help me.
![I'M SO HAPPY I COULD SHIT A RAINBOW RIGHT NOW :awesome:](./images/smilies/ms-awesome.png)