Class: PrimitiveShader

PIXI. PrimitiveShader

new PIXI.PrimitiveShader(shaderManager)

This shader is used to draw simple primitive shapes for PIXI.Graphics.

Name Type Description
shaderManager ShaderManager

The webgl shader manager this shader works for.

Extends

Members

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

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.