@ImaginaryVillain and
@Aesica
That would work, but only for the right side of the screen, we also need to have a buffer on the left side. I think the proper way to fix this issue is to have a buffer all around (there are some people that have vertical shake as well as horizontal).
this is what I'm thinking:
In gray is the lighting layer
In blue is the game screen
The yellow arrow is the buffer (for argument's sake 20 pixels)
So if screen (blue) starts at (0,0) and ends at (1280,720)
The layer (gray) should be (-20,-20) and ending at (1300, 740)
Edit: I've changed the value to 64, but it did not fix the issue (I have the feeling the value is hard coded in multiple places).
this._maskBitmap = new Bitmap(maxX + 64, maxY);