The base sampler shader exposes a simple sprite shader and all the framework to handle:

  • Batched shaders and plugin subscription
  • Configure method (for special processing done once or punctually)
  • Update method (pre-binding, normally done each frame) All other sampler shaders (batched or not) should extend BaseSamplerShader

Hierarchy (view full)

Properties

initialUniforms: object

The initial values of the shader uniforms.

classPluginName: string = "batch"

The named batch sampler plugin that is used by this shader, or null if no batching is used.

pausable: boolean = true

Is this shader pausable or not?

CONTRAST: string = ...

Contrast adjustment

SATURATION: string = ...

Saturation adjustment

EXPOSURE: string = ...

Exposure adjustment.

vertexShader: string = ...
fragmentShader: string = ...
batchVertexShader: string = ...

The batch vertex shader source.

batchFragmentShader: string = ...

The batch fragment shader source.

defaultUniforms: {
    sampler: number;
    tintAlpha: number[];
} = ...

The default uniform values for the shader. A subclass of AbstractBaseShader must implement the defaultUniforms static field.

Type declaration

  • sampler: number
  • tintAlpha: number[]
batchGeometry: any = PIXI.BatchGeometry

Batch geometry associated with this sampler.

batchVertexSize: number = 6

The size of a vertice with all its packed attributes.

batchDefaultUniforms: object = {}

A function that returns default uniforms associated with the batched version of this sampler.

reservedTextureUnits: number = 0

The number of reserved texture units for this shader that cannot be used by the batch renderer.

batchRendererClass: typeof BatchRenderer = BatchRenderer

The batch renderer to use.

batchShaderGeneratorClass: typeof BatchShaderGenerator = BatchShaderGenerator

The batch generator to use.

_packInterleavedGeometry: Function

Pack interleaved geometry custom function.

_preRenderBatch: ((batchRenderer) => void)

A prerender function happening just before the batch renderer is flushed.

Type declaration

    • (batchRenderer): void
    • Parameters

      Returns void

Accessors

  • get pluginName(): string
  • The plugin name associated for this instance, if any. Returns "batch" if the shader is disabled.

    Returns string

  • get enabled(): boolean
  • Activate or deactivate this sampler. If set to false, the batch rendering is redirected to "batch". Otherwise, the batch rendering is directed toward the instance pluginName (might be null)

    Returns boolean

  • get paused(): boolean
  • Pause or Unpause this sampler. If set to true, the shader is disabled. Otherwise, it is enabled. Contrary to enabled, a shader might decide to refuse a pause, to continue to render animations per example.

    Returns boolean

    See

  • get ADJUSTMENTS(): string
  • The adjustments made into fragment shaders.

    Returns string

Methods

  • Reset the shader uniforms back to their initial values.

    Returns void

  • Initialize the batch geometry with custom properties.

    Returns void

  • Create a batch plugin for this sampler class.

    Returns any

    The batch plugin class linked to this sampler class.

  • Register the plugin for this sampler.

    Parameters

    • Optional options: {
          force: object;
      } = {}

      The options

      • force: object

        Override the plugin of the same name that is already registered?

    Returns void