BUGFIX prefix sum algorithm from belloch for light offsets