class_docstr: Filter to apply a texture to a mesh.
  
  Note the texture is applied by multiplying the texture color by the
  Visual's produced color. By specifying `color="white"` when creating
  a `MeshVisual` the result will be the unaltered texture value. Any
  other color, including the default, will result in a blending of that
  color and the color of the texture.
  
  Parameters
  ----------
  texture : (M, N) or (M, N, C) array
      The 2D texture image.
  texcoords : (N, 2) array
      The texture coordinates.
  enabled : bool
      Whether the display of the texture is enabled.
  
  Examples
  --------
  See
  `examples/basics/scene/mesh_texture.py
  <https://github.com/vispy/vispy/blob/main/examples/basics/scene/mesh_texture.py>`_
  example script.
class_docstr_tok: ["Filter","to","apply","a","texture","to","a","mesh",".","Note","the","texture","is","applied","by","multiplying","the","texture","color","by","the","Visual","'s","produced","color",".","By","specifying","`","color=","''","white","''","`","when","creating","a","`","MeshVisual","`","the","result","will","be","the","unaltered","texture","value",".","Any","other","color",",","including","the","default",",","will","result","in","a","blending","of","that","color","and","the","color","of","the","texture",".","Parameters","--","--","--","--","--","texture",":","(","M",",","N",")","or","(","M",",","N",",","C",")","array","The","2D","texture","image",".","texcoords",":","(","N",",","2",")","array","The","texture","coordinates",".","enabled",":","bool","Whether","the","display","of","the","texture","is","enabled",".","Examples","--","--","--","--","See","`","examples\/basics\/scene\/mesh_texture.py","<","https",":","\/\/github.com\/vispy\/vispy\/blob\/main\/examples\/basics\/scene\/mesh_texture.py",">","`","_","example","script","."]
docstr: Apply a texture on a mesh.
docstr_tok: ["Apply","a","texture","on","a","mesh","."]
code: def __init__(self, texture, texcoords, enabled=True):
      """Apply a texture on a mesh."""
      vfunc = Function(
          """
              void pass_coords() {
                  $v_texcoords = $texcoords;
              }
          """
      )
      ffunc = Function(
          """
              void apply_texture() {
                  if ($enabled == 1) {
                      gl_FragColor *= texture2D($u_texture, $texcoords);
                  }
              }
          """
      )
      self._texcoord_varying = Varying("v_texcoord", "vec2")
      vfunc["v_texcoords"] = self._texcoord_varying
      ffunc["texcoords"] = self._texcoord_varying
      self._texcoords_buffer = VertexBuffer(
          np.zeros((0, 2), dtype=np.float32)
      )
      vfunc["texcoords"] = self._texcoords_buffer
      super().__init__(vcode=vfunc, vhook="pre", fcode=ffunc)
  
      self.enabled = enabled
      self.texture = texture
      self.texcoords = texcoords
  
imports: import numbers
  import numpy
  from vispy.gloo import Texture2D, VertexBuffer
  from vispy.visuals.shaders import Function, Varying
  from vispy.visuals.filters import Filter, PrimitivePickingFilter
  from ...color import Color
label_desc: Use image node_id 1 to create a new TextureFilter object from inherited base classes: Filter with example: obj = TextureFilter(texture, texcoords, enabled)