Returns perspective corrected interpolation of attributes over triangles.
tfg.rendering.opengl.math.perspective_correct_interpolation(
triangle_vertices_model_space, attribute, pixel_position, model_to_eye_matrix,
perspective_matrix, screen_dimensions, lower_left_corner=(0.0, 0.0), name=None
)
Note:
In the following, A1 to An are optional batch dimensions.
Args |
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.
|
attribute
|
A tensor of shape [A1, ..., An, 3, B] , where the last dimension
stores a per-vertex B -dimensional attribute.
|
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_interpolation'.
|
Raises |
tf.errors.InvalidArgumentError
|
if any input contains data not in the
specified range of valid values.
|
ValueError
|
If any input is of an unsupported shape.
|
Returns |
A tensor of shape [A1, ..., An, B] , containing interpolated attributes.
|