A downloadable asset pack

Download NowName your own price

This is a 2D Dynamic Lighting System made in GameMaker Studio 2. It is simple to implement compared to other lighting systems, has great quality and great performance, handling more than a thousand lights with no lag! 

Video Tutorials:

Blog Tutorial on GameMaker Community Forums:

https://forum.yoyogames.com/index.php?threads/ultra-fast-2d-dynamic-lighting-sys...

Demo:

  • left click to add light
  • right click to add 100 lights
  • F3 to display Debugger 
  • Q to restart
  • Directional keys  to move camera
Updated 29 days ago
StatusIn development
CategoryAssets
Rating
(2)
AuthorGrizzliusMaximus
GenrePlatformer
Tags2D, Tutorial

Download

Download NowName your own price

Click download now to get access to the following files:

DynamicLightsDemo.zip 1 MB
DynamicLights-Part1.yyz 15 kB
DynamicLights-Part2.yyz 33 kB
DynamicLights-Part5.yyz 60 kB

Development log

Comments

Log in with itch.io to leave a comment.

(1 edit)

Hello,
What an amazing tutorial. I don't get why it pop so late in my quest for "how to do normal mapping lighting" .... XD
I play a little with your example to see if I could use it with the way I'm drawing stuff onscreen and I have a question :
You use the Setup object to draw the robo with draw_self() but what if I assign my character's sprite dynamically, using draw_sprite and a Finite State Machine ? Is there a way to not have this normal bug and keep using my character's own draw-event ?

(+1)

Hello. This seems like the simplest and at the same time best lighting engine ive seen for gamemaker. Is there any way to support you and do you have any idea when a ready for use version will be available? Id also like to know if you are planning to make entities (characters and non solid objects) cast shadows too.
Thank you very much for making this.

(30 edits) (+1)

How do you fix this issues? 

 Main Problem :

  • Backwall moving  when left, right, up, down key is pressed.
  • Edit: found that it happens when object is following camera!

  

Other Problems:

Running game at 1080p, 8x8 textures is fine.  Running game at 1080p, "640, 360" 16x16 textures it breaks a lot of things... 

  • Backwalls are moving.
  • Player Stops following camera.
  • Mouse hover light is gone to oblivion and not centered around mouse.

I would really love to use this ~ best  lighting system ever, hands down!!! Thank you!!! (Lol don't mind the player sprite).

Your tutorials are great!  Is it possible to do tutorial with shaders/dynamic lighting with a 2.5 perspective like in your Beartopia game?  That would be really wonderful

(+1)

Do you know if this could be converted to use a a ds_grid instead of objects?  

I'm sure there is a way to use ds_grids. There is a part of the code where it iterates through every object. you can replace that code with ds_grids. It might make the game faster as empty objects still increase the lag. I used objects for ease of use.

(+1)

hello m8!! Sorry to bother you but i have been implementing your lights in gms2 and it is amazing btw! But i have 1 question. Where is the lights alpha set? I want to change it to a variable changeable in the object.

Hello there! Sorry I took me a long while to update this page. I have just uploaded a new version that covers everything till part 5 of my tutorial. To change the strength of the light, go to the obj_light variable definitions. You can also change each light individually in the room editor. 

thank you very much!!

This version does not work for me at all tho haha.

I have no idea what is wrong and i can not get it to work xD

The old version from tutorial 2 works fine but i can not change the alpha of the lights :-/

Somehow the alpha i set in the light color does not work in the game. any way to make this work?

Hello ! thanks for this engine ! 

I have little problem with tiles and layer, i download demo but light cast like this image : 

Not like your video, i think you understand the problem with this picture ;) 


Can you help me ? 


Thanks again very good job and perf :o 

Something wrong happened with the order of room layers. Try moving the layers around. The layer with object setup should be below the wall tiles.

Yes i see but look :

All is good for me i think in order because if i move the configuration instance layer like that :


With instances containe light and blue wall , and instance_1 contain : obj_setup.

with that configuration you can see light no render, tiles is directly lite at 100%.


Do you know why ?

Sorry for not responding to this for a month. I don't know what's gotten to me forgetting about this itch page. I really don't know what's wrong because it works for me. I have uploaded a new version with more features, maybe you want to check that one out :)

(+1)

thanks!!

(+1)

Awesome stuff! Any plans for sloping / triangle shaped tiles?

If you want, I will try to add those in as well

(+1)

WOAH, thanks for sharing! 🙏 

If is possible, can you share also the tileset?

I may do that later when I release the second tutorial :)

Oh, fantastic, thanks, I can’t wait 😁 

(+1)

Thank you very much!!!

your welcome!