docstr: Checks that two overlapping triangles are accumulated correctly.
docstr_tok: ["Checks","that","two","overlapping","triangles","are","accumulated","correctly","."]
code: def test_two_triangle_layers(self):
      """Checks that two overlapping triangles are accumulated correctly."""
      if (
          self._backend
          == rasterization_backend.RasterizationBackends.OPENGL
      ):
          self.skipTest(
              reason="OpenGL rasterizer only supports single layer."
          )
  
      image_width = 32
      image_height = 32
  
      vertices = tf.constant(
          [
              [
                  [-0.2, -0.2, 0],
                  [0.5, -0.2, 0],
                  [0.5, 0.5, 0],
                  [0.2, -0.2, 0.5],
                  [-0.5, -0.2, 0.5],
                  [-0.5, 0.5, 0.5],
              ]
          ],
          dtype=tf.float32,
      )
      triangles = [[0, 1, 2], [3, 5, 4]]
      colors = tf.constant(
          [
              [
                  [0, 1.0, 0, 1.0],
                  [0, 1.0, 0, 1.0],
                  [0, 1.0, 0, 1.0],
                  [1.0, 0, 0, 1.0],
                  [1.0, 0, 0, 1.0],
                  [1.0, 0, 0, 1.0],
              ]
          ],
          dtype=tf.float32,
      )
  
      composite, _, normalized_layers = splat.rasterize_then_splat(
          vertices,
          triangles,
          {"color": colors},
          rasterization_test_utils.get_identity_view_projection_matrix(),
          (image_height, image_width),
          lambda x: x["color"],
          num_layers=2,
          return_extra_buffers=True,
          backend=self._backend,
      )
  
      baseline_image = rasterization_test_utils.load_baseline_image(
          "Two_Triangles_Splat_Composite.png"
      )
      baseline_image = tf.image.resize(
          baseline_image, (image_height, image_width)
      )
      (
          images_near,
          error_message,
      ) = rasterization_test_utils.compare_images(
          self, baseline_image, composite
      )
      self.assertTrue(images_near, msg=error_message)
  
      for i in range(3):
          baseline_image = rasterization_test_utils.load_baseline_image(
              "Two_Triangles_Splat_Layer_{}.png".format(i)
          )
          image = normalized_layers[:, i, ...]
          image = tf.image.resize(
              image,
              (512, 512),
              method=tf.image.ResizeMethod.NEAREST_NEIGHBOR,
          )
          (
              images_near,
              error_message,
          ) = rasterization_test_utils.compare_images(
              self, baseline_image, image
          )
          self.assertTrue(images_near, msg=error_message)
  
file_path: graphics/tensorflow_graphics/rendering/tests/splat_test.py
imports: from absl.testing import parameterized
  import tensorflow
  from tensorflow_graphics.rendering import rasterization_backend
  from tensorflow_graphics.rendering import splat
  from tensorflow_graphics.rendering import triangle_rasterizer
  from tensorflow_graphics.rendering.tests import rasterization_test_utils
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 4 for calling the SplatTest obj's underlying member method code with example usage: obj.test_two_triangle_layers() without return types