I am working on a top-down 2D game. I would like to end up with something like this:
I can figure out the raycasting and the geometry bits. At which point I will have a set of polygons that I want to be light, and I want the rest of the map to be dark.
I do not know how to achieve this effect in unity, however. I am considering trying to apply an alpha mask to the camera such that it will only show the white polygons. I could then use Texture2D.SetPixels to update the alpha map.
Does anybody know if this is possible, or if there is an easier way to achieve the same effect?
Thankyou kindly.