• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 Subtract blend mode gets "thrown off" when player moves diagonally?

I just incorporated a shadow surface for when it is night time in my game. Right now, I have it so the player's brightness is constant, as in it isn't affected by the darkness, or any light sources. A silhouette also appears on the player if they walk behind something.

(Not relevant to the question at hand, but are these good choices, or should the darkness change the player's brightness? The game gets REAL dark at night... what are some examples of games that use these features?)

Anyway, I use bm_subtract to get the job done.
//create the surface

if !surface_exists(lightSurface){
   lightSurface = surface_create(room_width,room_height);

//draw the darkness


//subtract player from the darkness


//draw the surface

This works very well in the game. The player is subtracted from the darkness alright regardless whether I move up, down, left, or right. But, if I move diagonally at any point, it permanently throws the subtraction off by a hair of where it needs to be, like so:

It's also doing it for the purple portal just above, though I'm not sure why as that isn't moving. Any help?

EDIT: I didn't notice it before, but upon testing it in a different project, the whole surface seems to lag behind the player while they are moving and then catches up when the player stops. It looks like a “fade trail”. How do I fix this as well?
Last edited: