Added shadow optimization for when displaying shadow path to prevent unnecessary path calculations.