An efficient surface based 2d lighting and shadow system packed with features and optimizations.
Notice: Fast Lights only works with GameMaker Studio 1.x.
I tried to show off nearly all the features so you can see how to use them.
Should work on all platforms. Successfully tested on Windows, Android, and HTML5.
Shadow casters can be defined by a sprite, an arbitrary set of points, or a path.
Lights can be any gradient sprite, I made mine in GIMP by drawing a shape, adding a white to black gradient and then blurring it with a gaussian blur.
Works well with physics objects and is designed with views in mind. The light map surface only takes up the visible part of the screen and lights are not drawn on the outside of of it.
There is a quality setting that allows the light map to take up less texture memory by reducing the size of the surface and scaling it up when drawing, greatly improving the performance, particularly on mobile devices. The surface can be blurred to improve the look of the shadows.
The system is object oriented, heavily relying on instance variables so there can only be one light per object and only one caster per object.
Free to use in your project, even for commercial games.
Fixed the bounds checking in light_draw for off-centered lights.