Added a matlab function based on that shader in the paper.