PIXI.MeshMaterial

class MeshMaterial extends PIXI.Shader

Slightly opinionated default shader for PixiJS 2D objects.

Constructor


new PIXI.MeshMaterial(uSampler: PIXI.Texture, options: IMeshMaterialOptions) → {}
Parameters:
Name Type Attributes Default Description
uSampler PIXI.Texture

Texture that material uses to render.

options IMeshMaterialOptions

<optional>

Additional options

options.alpha number

<optional>

1

Default alpha.

options.tint number

<optional>

0xFFFFFF

Default tint.

options.pluginName string

<optional>

'batch'

Renderer plugin for batching.

options.program PIXI.Program

<optional>

0xFFFFFF

Custom program.

options.uniforms object

<optional>

Custom uniforms.

Summary


Properties from MeshMaterial

number
alpha = 1
boolean
batchable = true
string
pluginName = 'batch'
PIXI.Texture
texture

Reference to the texture being rendered.

number
tint = 0xFFFFFF
PIXI.TextureMatrix
uvMatrix

Methods from MeshMaterial

void
update()

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

void
protected render(renderer: PIXI.CanvasRenderer, mesh: PIXI.Mesh)

Properties inherited from Shader

PIXI.Program
program

Program that the shader uses.

Dict<any>
uniforms

Public Properties


alpha MeshMaterial.ts:119
alpha: number = 1

This gets automatically set by the object using this.

batchable MeshMaterial.ts:34
batchable: boolean = true

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

pluginName MeshMaterial.ts:40
pluginName: string = 'batch'

Renderer plugin for batching.

texture MeshMaterial.ts:100
texture: PIXI.Texture

Reference to the texture being rendered.

tint MeshMaterial.ts:135
tint: number = 0xFFFFFF

Multiply tint for the material.

uvMatrix MeshMaterial.ts:28
uvMatrix: PIXI.TextureMatrix

TextureMatrix instance for this Mesh, used to track Texture changes.

Public Methods


update MeshMaterial.ts:152
update() → {void}

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

Returns:
Type Description
void

Protected Methods


render MeshMaterial.ts:6
protected render(renderer: PIXI.CanvasRenderer, mesh: PIXI.Mesh) → {void}

Renders the mesh using the Canvas renderer

Parameters:
Name Type Description
renderer PIXI.CanvasRenderer

The canvas renderer.

mesh PIXI.Mesh

Mesh to render.

Returns:
Type Description
void

Powered by webdoc!