← all tags

#Lighting

3 entries

Another seemingly small, but large world editing update - dynamic ambient lighting! Up until now, my lighting layer had a single base color. I added functionality to my map loaded and scene renderer to change the ambient light based on the map default, or a dynamic ambient lighting area, defined with rectangle objects in Tiled. This will allow me to alter the base lighting room by room, or area by area.

In the screen shot below, you can see the rectangles around the temporary dungeon demo areas and the island area.

Now, with shaders! I had to work on a custom pixel fork to allow me to bind samples to uniforms accessed by custom shaders. This let me implement “screen” and “overlay” compositions to build my light map. Lights are now an extension of entities and have their own update behaviors (such as flickering for a torch, or pulsing for the coin).

Time to make the game moody :) I was able to add some basic lighting. This is just the beginning. I still need to render the actual entities (animated torch sprites) that are emitting the lights, add light fluctuations/jitter, and more lighting variations, maybe let entities hold lights, consider supporting shadows… the list goes on…