Class: MeshMaterial


Slightly opinionated default shader for PixiJS 2D objects.

new PIXI.MeshMaterial (uSampler, options) overrides

Name Type Attributes Default Description
uSampler PIXI.Texture

Texture that material uses to render.

options object <optional>

Additional options

options.alpha number <optional>

Default alpha.

options.tint number <optional>

Default tint.

options.pluginName string <optional>

Renderer plugin for batching.

options.program PIXI.Program <optional>

Custom program.

options.uniforms object <optional>

Custom uniforms.



alpha number

This gets automatically set by the object using this.

Default Value:
  • 1

batchable boolean

true if shader can be batch with the renderer's batch system.

Default Value:
  • true

pluginName string

Renderer plugin for batching

Default Value:
  • 'batch'

texture PIXI.Texture

Reference to the texture being rendered.

tint number

Multiply tint for the material.

Default Value:
  • 0xFFFFFF

uvMatrix PIXI.TextureMatrix readonly

TextureMatrix instance for this Mesh, used to track Texture changes


update () void

Gets called automatically by the Mesh. Intended to be overridden for custom MeshMaterial objects.

Inherited Properties

From class PIXI.Shader

Program that the shader uses

uniforms object readonly inherited

Shader uniform values, shortcut for uniformGroup.uniforms

Inherited Methods

From class PIXI.Shader

destroy () void inherited