View source on GitHub |
Computes per-triangle matrices used in barycentric coordinate calculation.
tfg.rendering.barycentrics.compute_triangle_matrices(
clip_space_vertices: type_alias.TensorLike,
triangles: type_alias.TensorLike
) -> tf.Tensor
The result corresponds to the inverse matrix from equation (4) in the paper "Triangle Scan Conversion using 2D Homogeneous Coordinates". Our matrix inverses are not divided by the determinant, only multiplied by its sign. The division happens in compute_barycentric_coordinates.
Returns | |
---|---|
3-D float32 tensor with shape [3, 3, triangle_count] containing per-triangle matrices. |