I'm trying to create a lighting engine for a 2D game. What I'm planning to do is something similar to this tutorial, specifically the concept of unwrapping the Cartesian coordinates to a 2D polar coordinate texture.
One of the big differences, however, is that he first creates a 1D texture of the distances the raycast travels, and then uses that information to draw the view mask. What I'd like to do is completely transform the occlusion mask into a 2D texture based on the polar coordinates and then do some other calculations.
How can I do that using OpenGL? Which kind of shader would that be?
(The full pipeline of the lighting: draw shadow mask onto texture -> unwrap that texture into polar map centered at light source -> color in that light mask based on the information in it -> re-wrap it into a Cartesian coordinate mask -> combine that information with the sprites being draw)