GameMaker (2.0 - 2.2.x)
Icon

Lighting System 2D

Jobo

You must be logged in to obtain assets

Description

Website

For more information, see http://thecode.cafe/posts/lighting-2d.

Learn to use this lighting system with Shaun Spalding: https://www.youtube.com/watch?v=RFRV3lhVOhg

Summary

This is a real-time and 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 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.

Link

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.

Lights

Lights are defined as a set of attributes that determine their behavior, so they are decoupled from the object that created them. These attributes include spatial information, rendering attributes like color, range and intensity and what type of light to use.

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

These light types give you a lot of possibilities for lighting up your game worlds.

More info

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS2 - Version 1.0.1. Published May 24, 2019

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait