I'm trying to write a shader with "block/tile-wise lighting" for sprites (Coloring entire objects/tiles with the same light & brightness).
But what I want should look something like this:
(I made this in Paint, so sorry for the bad quality)
If you want/need another example, here is a screenshot from the game Terraria, which this idea is based upon:
My idea would have been to simply access the lighting data of the center of a tile and use it for all pixels of the tile.
I'm relatively new to writing shaders, so I'm not even really sure if my idea is even possible (it probably is, but I lack the understanding to actually write the shader).
My main problem has been that I'm unable to access the lighting data of other pixels within the Surface Shader (which I based on the default Lambertian Surface Shader).
How can I do so or should I choose a completely different approach?
Every help is appreciated! Thank you in advance!