tfg.rendering.barycentrics.compute_barycentric_coordinates

Computes per-pixel barycentric coordinates.

triangle_ids 2-D int tensor with shape [image_height, image_width] containing per-pixel triangle ids, as computed by rasterize_triangles.
triangle_matrices 3-D float32 tensor with shape [3, 3, triangle_count] containing per-triangle matrices computed by compute_triangle_matrices.
px 2-D float32 tensor with shape [image_height, image_width] containing per-pixel x-coordinates, as computed by normalized_pixel_coordinates.
py 2-D float32 tensor with shape [image_height, image_width] containing per-pixel y-coordinates, as computed by normalized_pixel_coordinates.

3-D float32 tensor with shape [height, width, 3] containing the barycentric coordinates of the point at each pixel within the triangle specified by triangle_ids.