tfg.rendering.opengl.math.perspective_correct_barycentrics

Computes perspective correct barycentrics.

Note:

In the following, A1 to An are optional batch dimensions.

triangle_vertices_model_space A tensor of shape [A1, ..., An, 3, 3], where the last dimension represents the vertices of a triangle in model space.
pixel_position A tensor of shape [A1, ..., An, 2], where the last dimension stores the position (in pixels) where the interpolation is requested.
model_to_eye_matrix A tensor of shape [A1, ..., An, 4, 4], where the last two dimension represent matrices to transform points from model to eye coordinates.
perspective_matrix A tensor of shape [A1, ..., An, 4, 4], where the last two dimension represent matrices to transform points from eye to clip coordinates.
screen_dimensions A tensor of shape [A1, ..., An, 2], where the last dimension is expressed in pixels and captures the width and the height (in pixels) of the screen.
lower_left_corner A tensor of shape [A1, ..., An, 2], where the last dimension captures the position (in pixels) of the lower left corner of the screen.
name A name for this op. Defaults to 'perspective_correct_barycentrics'.

InvalidArgumentError if any input contains data not in the specified range of valid values.
ValueError If any input is of an unsupported shape.

A tensor of shape [A1, ..., An, 3], containing perspective correct barycentric coordinates.