#

API Docs for: 2.0.0
Show: Inherited Protected Private Deprecated

# PixiShader Class

Defined in: `src/pixi/renderers/webgl/shaders/PixiShader.js:6`
Module: PIXI

## Constructor

### `PixiShader`

(

- `gl`

)

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:6`

#### Parameters:

- `gl` WebGLContext

  the current WebGL drawing context

- Index
- Methods
- Properties

## Item Index

### Methods

- destroy
- init
- initSampler2D
- initUniforms
- syncUniforms

### Properties

- _UID
- attributes
- defaultVertexSrc
- dirty
- firstRun
- fragmentSrc
- gl
- program
- textureCount

## Methods

### `destroy`

()

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:351`

Destroys the shader.

### `init`

()

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:83`

Initialises the shader.

### `initSampler2D`

()

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:208`

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

### `initUniforms`

()

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:134`

Initialises the shader uniform values.

Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf

### `syncUniforms`

()

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:283`

Updates the shader uniform values.

## Properties

### `_UID`

Number private

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:13`

### `attributes`

Array private

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:70`

Uniform attributes cache.

### `defaultVertexSrc`

String

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:365`

The Default Vertex shader source.

### `dirty`

Boolean

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:63`

A dirty flag

### `firstRun`

Boolean private

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:55`

A local flag

### `fragmentSrc`

Array

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:33`

The fragment shader.

### `gl`

WebGLContext

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:20`

### `program`

Any

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:26`

The WebGL program.

### `textureCount`

Number

Defined in `src/pixi/renderers/webgl/shaders/PixiShader.js:48`

A local texture counter for multi-texture shaders.