Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MeshShader

Shader used specifically to render a mesh.

Hierarchy

  • Shader
    • MeshShader

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new MeshShader(program?: PIXI.Program, uniforms?: any): MeshShader
  • Parameters

    • Optional program: PIXI.Program
    • Optional uniforms: any

    Returns MeshShader

Properties

drawMode

drawMode: DRAW_MODES = PIXI.DRAW_MODES.TRIANGLES

Default draw mode used to render a mesh.

program

program: Program

Program that the shader uses

member

{PIXI.Program} PIXI.Shader#program

state

state: State & { clockwiseFrontFace: false; culling: true; depthTest: true } = Object.assign(new PIXI.State(), {culling: true, clockwiseFrontFace: false, depthTest: true})

Default state used to render a mesh.

uniforms

uniforms: any

Shader uniform values, shortcut for uniformGroup.uniforms

readonly
member

{object}

Accessors

name

  • get name(): string
  • The name of the mesh shader. Used for figuring out if geometry attributes is compatible with the shader. This needs to be set to something different than default value when custom attributes is used.

    Returns string

Methods

createShaderGeometry

  • Creates geometry with required attributes used by this shader. Override when using custom attributes.

    Parameters

    Returns Geometry

render

  • render(mesh: Mesh3D, renderer: Renderer, state?: PIXI.State, drawMode?: PIXI.DRAW_MODES): void
  • Renders the geometry of the specified mesh.

    Parameters

    • mesh: Mesh3D

      Mesh to render.

    • renderer: Renderer

      Renderer to use.

    • Optional state: PIXI.State

      Rendering state to use.

    • Optional drawMode: PIXI.DRAW_MODES

      Draw mode to use.

    Returns void

Static from

  • from(vertexSrc?: undefined | string, fragmentSrc?: undefined | string, uniforms?: any): Shader
  • A short hand function to create a shader based of a vertex and fragment shader

    Parameters

    • Optional vertexSrc: undefined | string
    • Optional fragmentSrc: undefined | string
    • Optional uniforms: any

    Returns Shader

    an shiny new Pixi shader!

Generated using TypeDoc