Computes per-pixel barycentric coordinates.
tfg.rendering.barycentrics.compute_barycentric_coordinates(
triangle_ids: type_alias.TensorLike,
triangle_matrices: type_alias.TensorLike,
px: type_alias.TensorLike,
py: type_alias.TensorLike
) -> tf.Tensor
Args |
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.
|
Returns |
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.
|