You can find MAX from x y z of light->pixel vector. Next for example, if MAX is X - divide vector on this scale (vec / x), next change other 2 values (y z) on offset components (j, k): y += j, z += k. This is values will be like UV coordinates.