Holographic optical elements for head-up display and near-eye display