docstr: Test output when rendering with PerspectiveCameras & OrthographicCameras
  in NDC vs screen space.
docstr_tok: ["Test","output","when","rendering","with","PerspectiveCameras","&","OrthographicCameras","in","NDC","vs","screen","space","."]
code: def test_simple_sphere_screen(self):
      """
      Test output when rendering with PerspectiveCameras & OrthographicCameras
      in NDC vs screen space.
      """
      device = torch.device("cuda:0")
  
      # Init mesh
      sphere_mesh = ico_sphere(5, device)
      verts_padded = sphere_mesh.verts_padded()
      faces_padded = sphere_mesh.faces_padded()
      feats = torch.ones_like(verts_padded, device=device)
      textures = TexturesVertex(verts_features=feats)
      sphere_mesh = Meshes(
          verts=verts_padded, faces=faces_padded, textures=textures
      )
  
      R, T = look_at_view_transform(2.7, 0.0, 0.0)
  
      # Init shader settings
      materials = Materials(device=device)
      lights = PointLights(device=device)
      lights.location = torch.tensor([0.0, 0.0, +2.0], device=device)[
          None
      ]
  
      raster_settings = RasterizationSettings(
          image_size=512, blur_radius=0.0, faces_per_pixel=1
      )
      half_half = (512.0 / 2.0, 512.0 / 2.0)
      for cam_type in (PerspectiveCameras, OrthographicCameras):
          cameras = cam_type(
              device=device,
              R=R,
              T=T,
              principal_point=(half_half,),
              focal_length=(half_half,),
              image_size=((512, 512),),
              in_ndc=False,
          )
          rasterizer = MeshRasterizer(
              cameras=cameras, raster_settings=raster_settings
          )
          blend_params = BlendParams(1e-4, 1e-4, (0, 0, 0))
  
          shader = HardPhongShader(
              lights=lights,
              cameras=cameras,
              materials=materials,
              blend_params=blend_params,
          )
          renderer = MeshRenderer(rasterizer=rasterizer, shader=shader)
          images = renderer(sphere_mesh)
          rgb = images[0, ..., :3].squeeze().cpu()
          filename = (
              "test_simple_sphere_light_phong_%s.png"
              % cam_type.__name__
          )
          if DEBUG:
              Image.fromarray(
                  (rgb.numpy() * 255).astype(np.uint8)
              ).save(DATA_DIR / f"{filename}_.png")
  
          image_ref = load_rgb_image(filename, DATA_DIR)
          self.assertClose(rgb, image_ref, atol=0.05)
  
imports: import os
  import unittest
  from collections import namedtuple
  from itertools import product
  import numpy
  import torch
  from PIL import Image
  from pytorch3d.io import load_obj, load_objs_as_meshes
  from pytorch3d.renderer import AmbientLights, FoVOrthographicCameras, FoVPerspectiveCameras, look_at_view_transform, Materials, MeshRasterizer, MeshRenderer, MeshRendererWithFragments, OrthographicCameras, PerspectiveCameras, PointLights, RasterizationSettings, TexturesAtlas, TexturesUV, TexturesVertex
  from pytorch3d.renderer.fisheyecameras import FishEyeCameras
  from pytorch3d.renderer.mesh.shader import BlendParams, HardFlatShader, HardGouraudShader, HardPhongShader, SoftPhongShader, SoftSilhouetteShader, SplatterPhongShader, TexturedSoftPhongShader
  from pytorch3d.renderer.opengl import MeshRasterizerOpenGL
  from pytorch3d.structures.meshes import join_meshes_as_batch, join_meshes_as_scene, Meshes
  from pytorch3d.utils.ico_sphere import ico_sphere
  from pytorch3d.utils.torus import torus
  from .common_testing import get_pytorch3d_dir, get_tests_dir, load_rgb_image, TestCaseMixin
label_desc: Use image node_id 4 for calling the TestRenderMeshes obj's underlying member method code with example usage: obj.test_simple_sphere_screen() without return types