# MeshProgram

moderngl_window.scene.MeshProgram

  Describes how a mesh is rendered using a specific shader program

## Methods

MeshProgram.__init__(program: Program = None, **kwargs)

  Initialize.

  Parameters:

    program – The moderngl program

MeshProgram.draw(mesh, projection_matrix: ndarray = None, model_matrix: ndarray = None, camera_matrix: ndarray = None, time=0.0)

  Draw code for the mesh

  Parameters:

    mesh (Mesh) – The mesh to render

  Keyword Arguments:

    - projection_matrix (numpy.ndarray) – projection_matrix (bytes)

    - model_matrix (numpy.ndarray) – view_matrix (bytes)

    - camera_matrix (numpy.ndarray) – camera_matrix (bytes)

    - time (float) – The current time

MeshProgram.apply(mesh)

  Determine if this `MeshProgram` should be applied to the mesh. Can return self or some `MeshProgram` instance to support dynamic `MeshProgram` creation

  Parameters:

    mesh – The mesh to inspect

## Attributes

MeshProgram.ctx

  The current context

  Type:

    moderngl.Context