add more optimization for shadows