use the gradient function in the texture function