[LibGDX] Directional/Surface Light

I’m making a 2D sidescroller game.
Using this (http://www.alcove-games.com/opengl-es-2-tutorials/lightmap-shader-fire-effect-glsl/) tutorial, I made some nice flickering light.

Using this method, how would I make directional light that only appears on the surface?
The blocks are stored in a 2D byte array.

You mean have it fade off the farther it goes underground? Well for that you’d probably have to do a per block lighting thing instead of using shaders. So each tile would have a light level, and you could do some maths that look at the nearest light, how many blocks are between it, and then base the light level on that. Or you should probably do it where each light tells the blocks around it what their light level should be. That way you wouldn’t have to calculate it for each tile. Yeah that’s a better idea. For a directional light it would be pretty much the same just from 1 direction.

I’ve tried doing that. It looked pretty bad.
I made a 2D light[][] array and calculated the level depending on where the block was.
Also, making it work with other light sources (torches, for example) was very difficult.
I’d really like to use shaders for this. It looks much smoother.
Also, I don’t need it to fade off, I just need the light to stop completely when it hits a solid block.

That could be very difficult, depending on how you do it. If you want the light to simply cut off, why not just do it on the CPU? I mean if you really want to do that with shaders (and if I understand what you want to do, it’s not necessary and will make things more complicated) then I suppose you could generate a texture on the CPU that shows the game where The highest block is at. So you could generate the texture so that the top layer of blocks would be red, all other blocks would be green and air would be blue or something. Then, in the shader sample the block reference texture and, if the pixel is red, calculate the lighting for it. If it’s green make it black, if it’s blue just pass through. It would create a straight cut off, but this could be done much easier on the CPU.

Edit: I forgot what the pic was. That’s a point light, not a directional light. But point light or directional light, it would still be pretty much the exact same method I just explained. Of course I just thought of it off the top of my head, so there are probably some better ways.