Class: TextureTintStripPipeline

Phaser.Renderer.WebGL.Pipelines. TextureTintStripPipeline

TextureTintStripPipeline implements the rendering infrastructure for displaying textured objects The config properties are:

  • game: Current game instance.
  • renderer: Current WebGL renderer.
  • vertShader: Source for vertex shader as a string.
  • fragShader: Source for fragment shader as a string.
  • vertexCapacity: The amount of vertices that shall be allocated
  • vertexSize: The size of a single vertex in bytes.

new TextureTintStripPipeline(config)

Parameters:
Name Type Description
config object

The configuration options for this Texture Tint Pipeline, as described above.

Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 16)

Extends

Members


active :boolean

Indicates if the current pipeline is active or not for this frame only. Reset in the onRender method.

Type:
  • boolean
Since: 3.10.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 230)

attributes :object

Array of objects that describe the vertex attributes

Type:
  • object
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 174)

batches :array

Collection of batch information

Type:
  • array
Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 120)

bytes :Uint8Array

Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU.

Type:
  • Uint8Array
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 201)

flushLocked :boolean

Indicates if the current pipeline is flushing the contents to the GPU. When the variable is set the flush function will be locked.

Type:
  • boolean
Since: 3.1.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 220)

game :Phaser.Game

The Game which owns this WebGL Pipeline.

Type:
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 65)

gl :WebGLRenderingContext

The WebGL context this WebGL Pipeline uses.

Type:
  • WebGLRenderingContext
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 110)

height :number

Height of the current viewport

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 101)

maxQuads :integer

Size of the batch.

Type:
  • integer
Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 111)

name :string

Name of the Pipeline. Used for identifying

Type:
  • string
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 56)

program :WebGLProgram

The handle to a WebGL program

Type:
  • WebGLProgram
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 165)

renderer :Phaser.Renderer.WebGL.WebGLRenderer

The WebGL Renderer which owns this WebGL Pipeline.

Type:
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 138)

resolution :number

Used to store the current game resolution

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 83)

topology :integer

The primitive topology which the pipeline will use to submit draw calls

Type:
  • integer
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 192)

vertexBuffer :WebGLBuffer

The handle to a WebGL vertex buffer object.

Type:
  • WebGLBuffer
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 156)

vertexCapacity :integer

The limit of vertices that the pipeline can hold

Type:
  • integer
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 129)

vertexComponentCount :integer

This will store the amount of components of 32 bit length

Type:
  • integer
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 211)

vertexCount :number

How many vertices have been fed to the current pipeline.

Type:
  • number
Since: 3.0.0
Inherited From:
Default Value:
  • 0
Source: src/renderer/webgl/WebGLPipeline.js (Line 119)

vertexData :ArrayBuffer

Raw byte buffer of vertices.

Type:
  • ArrayBuffer
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 147)

vertexSize :integer

The size in bytes of the vertex

Type:
  • integer
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 183)

vertexViewF32 :Float32Array

Float32 view of the array buffer containing the pipeline's vertices.

Type:
  • Float32Array
Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 93)

vertexViewU32 :Uint32Array

Uint32 view of the array buffer containing the pipeline's vertices.

Type:
  • Uint32Array
Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 102)

view :HTMLCanvasElement

The canvas which this WebGL Pipeline renders to.

Type:
  • HTMLCanvasElement
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 74)

width :number

Width of the current viewport

Type:
  • number
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 92)

Methods


addAttribute(name, size, type, normalized, offset)

Adds a description of vertex attribute to the pipeline

Parameters:
Name Type Description
name string

Name of the vertex attribute

size integer

Vertex component size

type integer

Type of the attribute

normalized boolean

Is the value normalized to a range

offset integer

Byte offset to the beginning of the first element in the vertex

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 254)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

bind()

Binds the pipeline resources, including programs, vertex buffers and binds attributes

Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 319)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

boot()

Called when the Game has fully booted and the Renderer has finished setting up.

By this stage all Game level systems are now in place and you can perform any final tasks that the pipeline may need that relied on game systems such as the Texture Manager.

Since: 3.11.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 241)

destroy()

Removes all object references in this WebGL Pipeline and removes its program from the WebGL context.

Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 454)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

flush()

Uploads the vertex data and emits a draw call for the current batch of vertices.

Since: 3.23.0
Overrides:
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 288)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

onBind()

Called every time the pipeline needs to be used. It binds all necessary resources.

Since: 3.23.0
Overrides:
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 162)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

onPostRender()

Called after each frame has been completely rendered and snapshots have been taken.

Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 405)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

onPreRender()

Called before each frame is rendered, but after the canvas has been cleared.

Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 374)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

onRender(scene, camera)

Called before a Scene's Camera is rendered.

Parameters:
Name Type Description
scene Phaser.Scene

The Scene being rendered.

camera Phaser.Cameras.Scene2D.Camera

The Scene Camera being rendered with.

Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 388)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

pushBatch(texture, unit)

Creates a new batch object and pushes it to a batch array. The batch object contains information relevant to the current vertex batch like the offset in the vertex buffer, vertex count and the textures used by that batch.

Parameters:
Name Type Description
texture WebGLTexture

Optional WebGLTexture that will be assigned to the created batch.

unit integer

Texture unit to which the texture needs to be bound.

Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 252)

requireTextureBatch(texture, unit)

Checks if the current batch has the same texture and texture unit, or if we need to create a new batch.

Parameters:
Name Type Description
texture WebGLTexture

WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.

unit integer

Texture unit to which the texture needs to be bound.

Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 225)
Returns:

true if the pipeline needs to create a new batch, otherwise false.

Type
boolean

resize(width, height, resolution)

Resizes this pipeline and updates the projection.

Parameters:
Name Type Description
width number

The new width.

height number

The new height.

resolution number

The resolution.

Since: 3.23.0
Overrides:
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 180)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat1(name, x)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x number

The new value of the float uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 476)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat1v(name, arr)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

arr Float32Array

The new value to be used for the uniform variable.

Since: 3.13.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 554)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat2(name, x, y)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x number

The new X component of the vec2 uniform.

y number

The new Y component of the vec2 uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 494)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat2v(name, arr)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

arr Float32Array

The new value to be used for the uniform variable.

Since: 3.13.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 572)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat3(name, x, y, z)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x number

The new X component of the vec3 uniform.

y number

The new Y component of the vec3 uniform.

z number

The new Z component of the vec3 uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 513)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat3v(name, arr)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

arr Float32Array

The new value to be used for the uniform variable.

Since: 3.13.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 590)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat4(name, x, y, z, w)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x number

X component of the uniform

y number

Y component of the uniform

z number

Z component of the uniform

w number

W component of the uniform

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 533)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setFloat4v(name, arr)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

arr Float32Array

The new value to be used for the uniform variable.

Since: 3.13.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 608)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setInt1(name, x)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x integer

The new value of the int uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 626)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setInt2(name, x, y)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x integer

The new X component of the ivec2 uniform.

y integer

The new Y component of the ivec2 uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 644)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setInt3(name, x, y, z)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x integer

The new X component of the ivec3 uniform.

y integer

The new Y component of the ivec3 uniform.

z integer

The new Z component of the ivec3 uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 663)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setInt4(name, x, y, z, w)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

x integer

X component of the uniform

y integer

Y component of the uniform

z integer

Z component of the uniform

w integer

W component of the uniform

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 683)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setMatrix2(name, transpose, matrix)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

transpose boolean

Whether to transpose the matrix. Should be false.

matrix Float32Array

The new values for the mat2 uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 704)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setMatrix3(name, transpose, matrix)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

transpose boolean

Whether to transpose the matrix. Should be false.

matrix Float32Array

The new values for the mat3 uniform.

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 723)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setMatrix4(name, transpose, matrix)

Set a uniform value of the current pipeline program.

Parameters:
Name Type Description
name string

The name of the uniform to look-up and modify.

transpose boolean

Should the matrix be transpose

matrix Float32Array

Matrix data

Since: 3.2.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 742)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

setTexture2D( [texture] [, unit])

Assigns a texture to the current batch. If a different texture is already set it creates a new batch object.

Parameters:
Name Type Argument Default Description
texture WebGLTexture <optional>

WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.

unit integer <optional>
0

Texture unit to which the texture needs to be bound.

Since: 3.23.0
Source: src/renderer/webgl/pipelines/TextureTintStripPipeline.js (Line 201)
Returns:

This pipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline

shouldFlush()

Check if the current batch of vertices is full.

Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/WebGLPipeline.js (Line 285)
Returns:

true if the current batch should be flushed, otherwise false.

Type
boolean