Dyanmic lighting in Mode 7
Posted: Fri May 26, 2023 6:41 am
Yupyupyup. I was messing around with the Playmat library, and thought "hey, it would be neat if I could add dynamic lighting here..." At first I tried using Luven, my go to. But because of how it handles the camera/etc, it didn't look right in Mode 7 at all. And the lights seemed to dip under the plane...no good.
But then I remembered- hey, I built a dynamic lighting library ages ago, one that could be used with tiles/etc, called SimpleLamp. I dug it back out, converted it to work with the latest iteration of Love, and viola! It works. It's great. It's a very simple idea, it calculates how much to light something based on the distance it is from a lightsource (or a lamp). So, both objects can be light by a certain %, but also individual tiles- this makes it ideal for Mode 7. I can render the tilemap with lighting separate onto a canvas, hand that canvas over to the Playmat library for displaying in Mode7, and then light each individual object, too. Looks nifty, works nice, and doesn't get slow down as long as I don't make the tiles too tiny or the maps too big.
Going to be now...cause it's late, but in the morning I plan on uploading a git repo of the latest version of SimpleLamp, with a quick example so if anyone else wants to use it, they can.
But then I remembered- hey, I built a dynamic lighting library ages ago, one that could be used with tiles/etc, called SimpleLamp. I dug it back out, converted it to work with the latest iteration of Love, and viola! It works. It's great. It's a very simple idea, it calculates how much to light something based on the distance it is from a lightsource (or a lamp). So, both objects can be light by a certain %, but also individual tiles- this makes it ideal for Mode 7. I can render the tilemap with lighting separate onto a canvas, hand that canvas over to the Playmat library for displaying in Mode7, and then light each individual object, too. Looks nifty, works nice, and doesn't get slow down as long as I don't make the tiles too tiny or the maps too big.
Going to be now...cause it's late, but in the morning I plan on uploading a git repo of the latest version of SimpleLamp, with a quick example so if anyone else wants to use it, they can.