Block lightning (Minecraft like)

Hello Community!

I’m working on a 2D minecraft like game. It doesn’t really matter if 2D oder 3D because my problem is very general.

Each of my chunks is made out of a 16 by 16 byte array. Each chunk has a single mesh. The textures are placed with uv coordinates from a texture atlas.

Now that I have the basics I wanted to implement some simple lighting. Like in Minecraft.
I’ve read many articles on the internet, but they are really general and don’t give the idea of how to implement it.

I understood that I have to make something like a floodfill and that every block needs a lightning value.

My question now is how do I change the color of specific uv coordinates? Is it even possible?

I hope some of you can give me some advice!
Thank you!

Vertex Colors

Just keep track of each Vertice iteration on a cube, on the mesh, and then you will be able to change the color.

Its this or a custom made shader with a Color value for each 256 cubes on a chunk.