So, I've been trying for a while to write something that achieves TERRAIN lighting similar to that of starbound:

But I'm not very good and the ones i manage to come up with are pretty inefficient and the framerate end up being rather poor using Java + openGL, shader based solutions.Plus it doesn't look very smooth around the edges

I think you could cache in each of your tile object the filled or empty state of each of that tiles neighbors and itself(and neighbors neighbors if you want a more gradual fade to black) and only update that data when a block is created or destroyed.Then when sending your vertex data to the gpu add a vertex attribute with this neighbor data encoded into it (how it is encoded will vary based on how you currently send you map data and how wide you want that fade to black to be.)Then in the frag shader figure out the distance that pixel is from the box representing the closest empty neighbor to that pixel to determine how dark that pixel of the map should be.

This should allow you to draw your map in one pass without any alpha blending.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org