2D Lighting for GameMaker Studio 2

This is a lightweight shader lighting system for dynamic pixel lights that composites multiple lights into a single surface. The surface is fitted to a "camera" that is used to perform the lighting pass. Instances that inherit from the object obj_shadow_caster are able to cast shadows, and lights are placed and configured in the game with instances of obj_light. It has good support for object variables.

It is my desire to provide a general lighting system that could be further customized (read: hacked) to suit the needs of each specific game project it is used in. To get the best performance, or lighting quality, or whatever else, for your game you will probably end up modifying it to some extent. It might also work well for your game or prototype out-of-the-box by tweaking some of the knobs.

You can easily upgrade the lighting system, once integrated in your game, to a newer version by simply replacing the previous version's assets in your project. It also tracks various statistics (if you opt in) that help you optimize your use of the system.

The following light types are supported at the time of writing:

  • Point Omnidirectional point emitter
  • Spot Conical point emitter
  • Area Unidirectional line emitter
  • Line Bidirectional line emitter
  • Directional Infinite directional light without an emitter source

Lighting Demo

Pull Requests & License

You're free to fork this project and to submit pull requests to the main repository. It's released under the MIT license. If you make good changes on a fork or personal project, everyone would benefit if you submit a pull request to bring those changes into the main repository as well.


Learn how to use this lighting system with Shaun Spalding's introduction video: https://www.youtube.com/watch?v=RFRV3lhVOhg.
The repository is hosted on GitHub and is available here: https://github.com/borup3/Lighting-System-2D.
The demo project repository is also hosted on GitHub and is available here: https://github.com/borup3/Lighting-System-2D-Demos.
It is also available on the Marketplace: https://marketplace.yoyogames.com/assets/7820/lighting-system-2d.