rogue 2D light and shadow using offscreen rendering Shadows are drawn first in white and then lights are drawn in black. Once we switch to the custom shader, the grayscale value of each pixel becomes the alpha value of a black pixel that will be drawn on top of the background.