Class: TextureShader

PIXI. TextureShader

new PIXI.TextureShader(shaderManager, vertexSrc, fragmentSrc, customUniforms, fragmentSrc)

Name Type Description
shaderManager PIXI.ShaderManager

The webgl shader manager this shader works for.

vertexSrc string optional

The source of the vertex shader.

fragmentSrc string optional

The source of the fragment shader.

customUniforms object optional

Custom uniforms to use to augment the built-in ones.

fragmentSrc string optional

The source of the fragment shader.

Extends

Members

static,constantPIXI.TextureShader.defaultFragmentSrc

The default fragment shader source

static,constantPIXI.TextureShader.defaultVertexSrc

The default vertex shader source

fragmentSrcstring

The fragment shader as an array of strings

readonlyglWebGLRenderingContext

The current WebGL drawing context

readonlyprogramWebGLProgram

The WebGL program.

readonlyuidnumber

A unique id

vertexSrcstring

The vertex shader as an array of strings

innerfragmentSrcstring

The fragment shader.

innervertexSrcstring

The vertex shader.

Methods

Caches the locations of the attribute for reuse.

Name Type Description
keys string

the attributes to cache

Caches the locations of the uniform for reuse.

Name Type Description
keys string

the uniforms to cache

Attaches the shaders and creates the program.

Returns:
Type Description
WebGLProgram

Destroys the shader.

Creates the shader and uses it

Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)

Adds a new uniform

Name Type Description
uniform object

the new uniform to attach

Updates the shader uniform values.