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",")","."]
code: def to(self, device):
      # Manually move to device cameras as it is not a subclass of nn.Module
      if self.cameras is not None:
          self.cameras = self.cameras.to(device)
  
      # Create a new OpenGLMachinery, as its member variables can be tied to a GPU.
      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 3 for calling the MeshRasterizerOpenGL obj's underlying member method code with example usage: obj.to(device) without return types