Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MeshShader

Shader used specifically to render a mesh.

Hierarchy

  • Shader
    • MeshShader

Index

Constructors

constructor

  • new MeshShader(program: Program, uniforms?: Dict<any>): MeshShader
  • Parameters

    • program: Program
    • Optional uniforms: Dict<any>

    Returns MeshShader

Properties

Private _state

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

program

program: Program

uniformGroup

uniformGroup: UniformGroup

Accessors

name

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

    Returns string

uniforms

  • get uniforms(): Dict<any>
  • Shader uniform values, shortcut for uniformGroup.uniforms

    readonly
    member

    {object}

    Returns Dict<any>

Methods

checkUniformExists

  • checkUniformExists(name: string, group: UniformGroup): boolean
  • Parameters

    • name: string
    • group: UniformGroup

    Returns boolean

createShaderGeometry

  • createShaderGeometry(geometry: MeshGeometry3D, instanced: boolean): Geometry
  • Creates geometry with required attributes used by this shader. Override when using custom attributes.

    Parameters

    • geometry: MeshGeometry3D

      The geometry with mesh data.

    • instanced: boolean

      Value indicating if the geometry will be instanced.

    Returns Geometry

destroy

  • destroy(): void
  • Returns void

render

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

    Parameters

    • mesh: Mesh3D

      Mesh to render.

    • renderer: Renderer

      Renderer to use.

    • Default value state: State = this._state

      Rendering state to use.

    • Default value drawMode: DRAW_MODES = PIXI.DRAW_MODES.TRIANGLES

      Draw mode to use.

    Returns void

Static from

  • from(vertexSrc?: undefined | string, fragmentSrc?: undefined | string, uniforms?: Dict<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: Dict<any>

    Returns Shader

    an shiny new Pixi shader!

Generated using TypeDoc