Home Artists Posts Import Register

Content

Hello all! Here's the video I've been working on about the lighting system in PokeyPoke! It's extremely performance friendly and lightweight. I'm a little light on some of the details in this video and mostly focus on the overall logic (a direct step-by-step video would have been enormously heavy, and also the way I've written it isn't super optimized so I didn't feel confident making it into a capital T Tutorial.) but with some work the more intermediate coders among you should be able to replicate something like this for your own games!

If this is too much for you and you still want to put lights and shadows into your game I still recommend the many lighting systems made by various members of the community and my previous video on the subject.

I've wanted to share something on this for a while as the whole system comes down to a *one* line shader which does all of the heavy lifting and actual shadow casting. The rest is just some surfaces and blend modes!

Hope this is useful!

$20 supporters will get access to the source code of my original "test" environment I used to build the system! (I've cleaned it up a bit, removed pokeypoke artwork (sorry!) and added a few more code comments.)

I would love to give access to a wider group and putting it on itch etc, but while I'm really proud of this system I don't feel confident "selling" it (yet) as there's so many optimizations that could be easily made and it's not super easy to port into just any game. Something I might work towards though!

This video goes live to all on Friday.

-S

Files

GameMaker Studio 2 - Ultra Fast Lighting System - "Here's how I did it"

Extremely lightweight, high performance shadow rendering in GameMaker Studio 2, or anything that lets you write shaders really. ▶ Source Code: https://www.patreon.com/posts/dynamic-lights-59325686 ▶ Support my work: https://www.patreon.com/shaunjs ▶ PokeyPoke on Steam: https://store.steampowered.com/app/1083230/PokeyPoke/

Comments

Anonymous

hi just joined, where can i find the code?

shaunjs

Hi! There's a link in the post :) edit: I notice this isn't working, oops. Will sort this out tomorrow

Anonymous

thanks for the video! Helped a lot. I had a couple questions: I'm having trouble implementing this with a camera system unless I draw a surface the size of the whole room. And have you worked out a solution for moving Entities?

shaunjs

Hey sorry for missing this! I haven't looked into moving entities yet but I have a reasonably good idea of how I'll approach it (just passing an x/y offset value to the shader). I do remember there being a few nuances with getting the moving camera to work as I needed to pass some other bits to the shader (see the one line shader in the video, i think it has some camPos variables involved?) The tricky thing then with anything involving a surface and a moving camera is you need to subtract the position of the camera from the position of anything you want to draw to the surface, so that it ends up in the right place (as 0,0 on your surface is equal to the x/y position of the camera in the room)