Created a small kernel to calculate barycentric triangle coords.