Microscopic theory for the luminescence of mid infrared semiconductor materials