Implement a texture interpolation function