I'm working on a formular to calculate the index for the frustum of a 2D-Point-Light.
My Light-System is rendering the Scene into 4 1D-Textures: Right, Left, Top and Bottom.
Now, in the fragment shader I want to query the index for the frustum corresponding to the fragment position in light-space,
so I know which depth texture I have to sample.
I got one that works, but it's very complicated.
Or should I just do a series of "if" statements.
My concern with that is, that inside a warp, only the body of one if-statement can be entered, which leaves all fragments idling, if they have different frustum.