So I am currently developing a 2D sandbox game similar to Terraria and Starbound. I would like to set up the lighting for the game at this point similar to that of the games mentioned above. I have never done lighting before so I am curious if there are any guides or methods or anything out there that anybody might suggest.
Here is what we have right now:
Lighting used is just a simple directional light. We are looking for something more like this:
As you can see in the second screen shot (Starbound), the light does not penetrate all the way through the terrain. Almost like a fog of war type of effect going on there, except instead of showing previously explored areas it only shows illuminated areas. I am curious how this effect might be achieved, any and all help is appreciated!
P.S. - We are currently using a mesh based system for loading chunks of blocks near the player. Block data is saved to map file in the form of a multi-dimensional array of ushorts (for blockID) that makes up the walls and fronts.