class_docstr: Base class for CPU/GPU rasterization backend tests.
class_docstr_tok: ["Base","class","for","CPU\/GPU","rasterization","backend","tests","."]
docstr: Directly renders a rasterized triangle's barycentric coordinates.
docstr_tok: ["Directly","renders","a","rasterized","triangle","'s","barycentric","coordinates","."]
code: def test_render_simple_triangle(self):
      """Directly renders a rasterized triangle's barycentric coordinates."""
      w_vector = tf.constant([1.0, 1.0, 1.0], dtype=tf.float32)
      clip_init = tf.constant(
          [[[-0.5, -0.5, 0.8], [0.0, 0.5, 0.3], [0.5, -0.5, 0.3]]],
          dtype=tf.float32,
      )
      clip_coordinates = clip_init * tf.reshape(w_vector, [1, 3, 1])
      triangles = tf.constant([[0, 1, 2]], dtype=tf.int32)
  
      face_culling_enabled = False
      framebuffer = rasterization_backend.rasterize(
          clip_coordinates,
          triangles,
          tf.eye(4, batch_shape=[1]),
          (self.IMAGE_WIDTH, self.IMAGE_HEIGHT),
          face_culling_enabled,
          self._num_layers,
          self._backend,
      ).layer(0)
      ones_image = tf.ones([1, self.IMAGE_HEIGHT, self.IMAGE_WIDTH, 1])
      rendered_coordinates = tf.concat(
          [framebuffer.barycentrics.value, ones_image], axis=-1
      )
  
      baseline_image = rasterization_test_utils.load_baseline_image(
          "Simple_Triangle.png", rendered_coordinates.shape
      )
  
      (
          images_near,
          error_message,
      ) = rasterization_test_utils.compare_images(
          self, baseline_image, rendered_coordinates
      )
      self.assertTrue(images_near, msg=error_message)
  
file_path: graphics/tensorflow_graphics/rendering/tests/rasterization_backend_test_base.py
imports: from absl.testing import parameterized
  import tensorflow
  from tensorflow_graphics.rendering import rasterization_backend
  from tensorflow_graphics.rendering.tests import rasterization_test_utils
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 7 for calling the RasterizationBackendTestBase obj's underlying member method code with example usage: obj.test_render_simple_triangle() without return types