Introduced helper functions to sample distance fields.