Hi

I do something like that in my game. The code is integrated in the movement routine where it traces for the ground. The "c_trace" is done with "SCAN_TEXTURE" set. The varibale "tex_light" afterwarts contains brightness below player entity.