match materials to the reference image