For mesh sampling.