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).

Version 1.0.0. Published January 16, 2019

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Gravatar

Anonymous 23 April 2019


Gravatar

Anonymous 18 April 2019


Gravatar

Anonymous 18 April 2019


Gravatar

Anonymous 17 April 2019


Gravatar

Anonymous 15 April 2019

Doesnt work on Mac currently.

Other than that it is great. Works good on PC.


Gravatar

Anonymous 10 April 2019


Gravatar

Drake D 06 April 2019


Gravatar

Anonymous 06 April 2019


Gravatar

Anonymous 03 April 2019


Gravatar

Anonymous 31 March 2019


Gravatar

Anonymous 27 March 2019


Gravatar

Panayiotis Y 25 March 2019


Gravatar

Anonymous 20 March 2019


Gravatar

Zinan M 19 March 2019

Question On Light demo

Amazing system! I only have one question, for some reason anytime I use a non-spot light type my light map will have a weird box around it. If I adjust my light range the box will then slowly become visible like here:

https://i.imgur.com/iPeBSax.gifv

Any idea what I did wrong here...?


Gravatar

Oku O 16 March 2019


Gravatar

Anonymous 06 March 2019


Gravatar

Denis I 01 March 2019


Gravatar

Xinwei Y 23 February 2019


Gravatar

Amin E 22 February 2019


Gravatar

Anonymous 21 February 2019

Its Good

Performance struggles a bit with large room sizes, other than that its great and exactly what I was looking for.

Logo

Jobo (Publisher) 23 February 2019

I'm glad you can use it! All games use lighting differently, so optimization is something you should do based on what you need from the lighting system (like deactivating shadow caster instances and lights when you know you can).


Gravatar

Anonymous 20 February 2019


Gravatar

Anonymous 19 February 2019


Gravatar

Anonymous 18 February 2019


Gravatar

Anonymous 15 February 2019


Gravatar

Anonymous 14 February 2019


Gravatar

Anonymous 14 February 2019

Kemp

This looks SO cool, but does not work on Mac :( Posted a comment on Sean Spaulding's (always) brilliant turorial on the system. Seems it simply doesn't work for Mac users. REALLY hope it's fixable with a future update. Still, didn't want to bog down the review score based on something that can hopefully soon be fixed. Fingers crossed!

Logo

Jobo (Publisher) 16 February 2019

Hi, I'll take a look to see what's going on when I have access to a mac. It should all work fine. I'll update when the issue is fixed, if I find one.


Gravatar

Anonymous 13 February 2019


Gravatar

Anonymous 12 February 2019


Gravatar

Anonymous 12 February 2019


Gravatar

Anonymous 11 February 2019


Gravatar

Anonymous 11 February 2019


Gravatar

Anonymous 11 February 2019


Gravatar

Nate W 10 February 2019


Gravatar

Victor L 10 February 2019


Gravatar

Miroslaw Z 10 February 2019

don't work on OSX

No visible lights and shadow on Mac OS :/ Only show normal screen.

Logo

Jobo (Publisher) 11 February 2019

Hi Miroslaw, I'll take a look to see what's going on when I have access to a mac. It should all work fine. I'll update when the issue is fixed, if I find one.


Gravatar

Anonymous 09 February 2019


Gravatar

Anonymous 09 February 2019


Gravatar

Anonymous 09 February 2019


Gravatar

James W 09 February 2019


Gravatar

Mauricio C 09 February 2019


Gravatar

Mitchell F 08 February 2019


Gravatar

Anonymous 08 February 2019


Gravatar

James W 08 February 2019


Gravatar

Ofek B 08 February 2019

Package contents

Loading, please wait

What is the issue?

Back to Top