class_docstr: EXPERIMENTAL, USE WITH CAUTION
  
  This class implements methods for rasterizing a batch of heterogeneous
  Meshes using OpenGL. This rasterizer, as opposed to MeshRasterizer, is
  *not differentiable* and needs to be used with shading methods such as
  SplatterPhongShader, which do not require differentiable rasterizerization.
  It is, however, faster: on a 2M-faced mesh, about 20x so.
  
  Fragments output by MeshRasterizerOpenGL and MeshRasterizer should have near
  identical pix_to_face, bary_coords and zbuf. However, MeshRasterizerOpenGL does not
  return Fragments.dists which is only relevant to SoftPhongShader and
  SoftSilhouetteShader. These do not work with MeshRasterizerOpenGL (because it is
  not differentiable).
class_docstr_tok: ["EXPERIMENTAL",",","USE","WITH","CAUTION","This","class","implements","methods","for","rasterizing","a","batch","of","heterogeneous","Meshes","using","OpenGL",".","This","rasterizer",",","as","opposed","to","MeshRasterizer",",","is","*","not","differentiable","*","and","needs","to","be","used","with","shading","methods","such","as","SplatterPhongShader",",","which","do","not","require","differentiable","rasterizerization",".","It","is",",","however",",","faster",":","on","a","2M-faced","mesh",",","about","20x","so",".","Fragments","output","by","MeshRasterizerOpenGL","and","MeshRasterizer","should","have","near","identical","pix_to_face",",","bary_coords","and","zbuf",".","However",",","MeshRasterizerOpenGL","does","not","return","Fragments.dists","which","is","only","relevant","to","SoftPhongShader","and","SoftSilhouetteShader",".","These","do","not","work","with","MeshRasterizerOpenGL","(","because","it","is","not","differentiable",")","."]
docstr: Args:
      cameras: A cameras object which has a `transform_points` method
          which returns the transformed points after applying the
          world-to-view and view-to-ndc transformations. Currently, only FoV
          cameras are supported.
      raster_settings: the parameters for rasterization. This should be a
          named tuple.
docstr_tok: ["Args",":","cameras",":","A","cameras","object","which","has","a","`","transform_points","`","method","which","returns","the","transformed","points","after","applying","the","world-to-view","and","view-to-ndc","transformations",".","Currently",",","only","FoV","cameras","are","supported",".","raster_settings",":","the","parameters","for","rasterization",".","This","should","be","a","named","tuple","."]
code: def __init__(
      self,
      cameras: Optional[
          Union[FoVOrthographicCameras, FoVPerspectiveCameras]
      ] = None,
      raster_settings=None,
  ) -> None:
      """
      Args:
          cameras: A cameras object which has a `transform_points` method
              which returns the transformed points after applying the
              world-to-view and view-to-ndc transformations. Currently, only FoV
              cameras are supported.
          raster_settings: the parameters for rasterization. This should be a
              named tuple.
      """
      super().__init__()
      if raster_settings is None:
          raster_settings = RasterizationSettings()
      self.raster_settings = raster_settings
      _check_raster_settings(self.raster_settings)
      self.cameras = cameras
      self.image_size = _parse_and_verify_image_size(
          self.raster_settings.image_size
      )
  
      self.opengl_machinery = _OpenGLMachinery(
          max_faces=self.raster_settings.max_faces_opengl,
      )
  
imports: import warnings
  from typing import Optional, Tuple, Union
  import numpy
  import OpenGL.GL
  import pycuda.gl
  import torch
  import torch.nn
  from pytorch3d.structures.meshes import Meshes
  from ..cameras import FoVOrthographicCameras, FoVPerspectiveCameras
  from ..mesh.rasterizer import Fragments, RasterizationSettings
  from ..utils import parse_image_size
  from .opengl_utils import _torch_to_opengl, global_device_context_store
label_desc: Use image node_id 1 to create a new MeshRasterizerOpenGL object from inherited base classes: nn with example: obj = MeshRasterizerOpenGL(cameras, raster_settings)