(Glide2GL) Refactor calc_light