Class: ForwardDiffuseLightPipeline

Phaser.Renderer.WebGL.Pipelines. ForwardDiffuseLightPipeline

ForwardDiffuseLightPipeline implements a forward rendering approach for 2D lights.
This pipeline extends TextureTintPipeline so it implements all it's rendering functions
and batching system.


new ForwardDiffuseLightPipeline(config)

Parameters:
Name Type Description
config object

[description]

Since: 3.0.0
Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 14)

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.1.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 124)

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

[description]

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

gl :WebGLRenderingContext

[description]

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.0.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 115)

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

[description]

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.0.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 97)

vertexViewU32 :Uint32Array

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

Type:
  • Uint32Array
Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 106)

view :HTMLCanvasElement

[description]

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.ForwardDiffuseLightPipeline

batchFillPath(path, currentMatrix, parentMatrix)

Adds the given path to the vertex batch for rendering.

It works by taking the array of path data and then passing it through Earcut, which
creates a list of polygons. Each polygon is then added to the batch.

The path is always automatically closed because it's filled.

Parameters:
Name Type Description
path array

Collection of points that represent the path.

currentMatrix Phaser.GameObjects.Components.TransformMatrix

The current transform.

parentMatrix Phaser.GameObjects.Components.TransformMatrix

The parent transform.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1214)

batchFillRect(x, y, width, height, currentMatrix, parentMatrix)

Pushes a filled rectangle into the vertex batch.
Rectangle factors in the given transform matrices before adding to the batch.

Parameters:
Name Type Description
x number

Horizontal top left coordinate of the rectangle.

y number

Vertical top left coordinate of the rectangle.

width number

Width of the rectangle.

height number

Height of the rectangle.

currentMatrix Phaser.GameObjects.Components.TransformMatrix

The current transform.

parentMatrix Phaser.GameObjects.Components.TransformMatrix

The parent transform.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1075)

batchFillTriangle(x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix)

Pushes a filled triangle into the vertex batch.
Triangle factors in the given transform matrices before adding to the batch.

Parameters:
Name Type Description
x0 number

Point 0 x coordinate.

y0 number

Point 0 y coordinate.

x1 number

Point 1 x coordinate.

y1 number

Point 1 y coordinate.

x2 number

Point 2 x coordinate.

y2 number

Point 2 y coordinate.

currentMatrix Phaser.GameObjects.Components.TransformMatrix

The current transform.

parentMatrix Phaser.GameObjects.Components.TransformMatrix

The parent transform.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1126)

batchLine(ax, ay, bx, by, aLineWidth, bLineWidth, currentMatrix)

Creates a quad and adds it to the vertex batch based on the given line values.

Parameters:
Name Type Description
ax number

X coordinate to the start of the line

ay number

Y coordinate to the start of the line

bx number

X coordinate to the end of the line

by number

Y coordinate to the end of the line

aLineWidth number

Width of the start of the line

bLineWidth number

Width of the end of the line

currentMatrix Float32Array

Parent matrix, generally used by containers

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1343)

batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect)

Adds the vertices data into the batch and flushes if full.

Assumes 6 vertices in the following arrangement:

0----3
|\  B|
| \  |
|  \ |
| A \|
|    \
1----2

Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3

Parameters:
Name Type Description
x0 number

The top-left x position.

y0 number

The top-left y position.

x1 number

The bottom-left x position.

y1 number

The bottom-left y position.

x2 number

The bottom-right x position.

y2 number

The bottom-right y position.

x3 number

The top-right x position.

y3 number

The top-right y position.

u0 number

UV u0 value.

v0 number

UV v0 value.

u1 number

UV u1 value.

v1 number

UV v1 value.

tintTL number

The top-left tint color value.

tintTR number

The top-right tint color value.

tintBL number

The bottom-left tint color value.

tintBR number

The bottom-right tint color value.

tintEffect number | boolean

The tint effect for the shader to use.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 629)
Returns:

true if this method caused the batch to flush, otherwise false.

Type
boolean

batchSprite(sprite, camera, parentTransformMatrix)

[description]

Parameters:
Name Type Description
sprite Phaser.GameObjects.Sprite

[description]

camera Phaser.Cameras.Scene2D.Camera

[description]

parentTransformMatrix Phaser.GameObjects.Components.TransformMatrix

[description]

Since: 3.0.0
Overrides:
Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 415)

batchStrokePath(path, lineWidth, pathOpen, currentMatrix, parentMatrix)

Adds the given path to the vertex batch for rendering.

It works by taking the array of path data and calling batchLine for each section
of the path.

The path is optionally closed at the end.

Parameters:
Name Type Description
path array

Collection of points that represent the path.

lineWidth number

The width of the line segments in pixels.

pathOpen boolean

Indicates if the path should be closed or left open.

currentMatrix Phaser.GameObjects.Components.TransformMatrix

The current transform.

parentMatrix Phaser.GameObjects.Components.TransformMatrix

The parent transform.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1295)

batchStrokeTriangle(x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix)

Pushes a stroked triangle into the vertex batch.
Triangle factors in the given transform matrices before adding to the batch.
The triangle is created from 3 lines and drawn using the batchStrokePath method.

Parameters:
Name Type Description
x0 number

Point 0 x coordinate.

y0 number

Point 0 y coordinate.

x1 number

Point 1 x coordinate.

y1 number

Point 1 y coordinate.

x2 number

Point 2 x coordinate.

y2 number

Point 2 y coordinate.

lineWidth number

The width of the line in pixels.

currentMatrix Phaser.GameObjects.Components.TransformMatrix

The current transform.

parentMatrix Phaser.GameObjects.Components.TransformMatrix

The parent transform.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1173)

batchTexture(gameObject, texture, textureWidth, textureHeight, srcX, srcY, srcWidth, srcHeight, scaleX, scaleY, rotation, flipX, flipY, scrollFactorX, scrollFactorY, displayOriginX, displayOriginY, frameX, frameY, frameWidth, frameHeight, tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, parentTransformMatrix)

Generic function for batching a textured quad

Parameters:
Name Type Description
gameObject Phaser.GameObjects.GameObject

Source GameObject

texture WebGLTexture

Raw WebGLTexture associated with the quad

textureWidth integer

Real texture width

textureHeight integer

Real texture height

srcX number

X coordinate of the quad

srcY number

Y coordinate of the quad

srcWidth number

Width of the quad

srcHeight number

Height of the quad

scaleX number

X component of scale

scaleY number

Y component of scale

rotation number

Rotation of the quad

flipX boolean

Indicates if the quad is horizontally flipped

flipY boolean

Indicates if the quad is vertically flipped

scrollFactorX number

By which factor is the quad affected by the camera horizontal scroll

scrollFactorY number

By which factor is the quad effected by the camera vertical scroll

displayOriginX number

Horizontal origin in pixels

displayOriginY number

Vertical origin in pixels

frameX number

X coordinate of the texture frame

frameY number

Y coordinate of the texture frame

frameWidth number

Width of the texture frame

frameHeight number

Height of the texture frame

tintTL integer

Tint for top left

tintTR integer

Tint for top right

tintBL integer

Tint for bottom left

tintBR integer

Tint for bottom right

tintEffect number

The tint effect (0 for additive, 1 for replacement)

uOffset number

Horizontal offset on texture coordinate

vOffset number

Vertical offset on texture coordinate

camera Phaser.Cameras.Scene2D.Camera

Current used camera

parentTransformMatrix Phaser.GameObjects.Components.TransformMatrix

Parent container

Since: 3.0.0
Inherited From:
Overrides:
Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 164)

batchTextureFrame(frame, x, y, tint, alpha, transformMatrix [, parentTransformMatrix])

Adds a Texture Frame into the batch for rendering.

Parameters:
Name Type Argument Description
frame Phaser.Textures.Frame

The Texture Frame to be rendered.

x number

The horizontal position to render the texture at.

y number

The vertical position to render the texture at.

tint number

The tint color.

alpha number

The alpha value.

transformMatrix Phaser.GameObjects.Components.TransformMatrix

The Transform Matrix to use for the texture.

parentTransformMatrix Phaser.GameObjects.Components.TransformMatrix <optional>

A parent Transform Matrix.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 992)

batchTri(x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect)

Adds the vertices data into the batch and flushes if full.

Assumes 3 vertices in the following arrangement:

0
|\
| \
|  \
|   \
|    \
1-----2
Parameters:
Name Type Description
x1 number

The bottom-left x position.

y1 number

The bottom-left y position.

x2 number

The bottom-right x position.

y2 number

The bottom-right y position.

x3 number

The top-right x position.

y3 number

The top-right y position.

u0 number

UV u0 value.

v0 number

UV v0 value.

u1 number

UV u1 value.

v1 number

UV v1 value.

tintTL number

The top-left tint color value.

tintTR number

The top-right tint color value.

tintBL number

The bottom-left tint color value.

tintEffect number | boolean

The tint effect for the shader to use.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 732)
Returns:

true if this method caused the batch to flush, otherwise false.

Type
boolean

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 314)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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:
Overrides:
Source: src/renderer/webgl/WebGLPipeline.js (Line 241)

destroy()

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

drawFillRect(x, y, width, height, color, alpha)

Pushes a filled rectangle into the vertex batch.
Rectangle has no transform values and isn't transformed into the local space.
Used for directly batching untransformed rectangles, such as Camera background colors.

Parameters:
Name Type Description
x number

Horizontal top left coordinate of the rectangle.

y number

Vertical top left coordinate of the rectangle.

width number

Width of the rectangle.

height number

Height of the rectangle.

color number

Color of the rectangle to draw.

alpha number

Alpha value of the rectangle to draw.

Since: 3.12.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1050)

flush()

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

Since: 3.0.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 383)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

onBind()

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

Since: 3.0.0
Inherited From:
Overrides:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 266)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

onPostRender()

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

onPreRender()

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

onRender(scene, camera)

This function sets all the needed resources for each camera pass.

Parameters:
Name Type Description
scene Phaser.Scene

[description]

camera Phaser.Cameras.Scene2D.Camera

[description]

Since: 3.0.0
Overrides:
Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 99)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

pushBatch()

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.

Since: 3.1.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 363)

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.0.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 289)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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 547)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

y number

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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 565)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

y number

[description]

z number

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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 583)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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 526)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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 601)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

y integer

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

y integer

[description]

z integer

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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 676)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

matrix Float32Array

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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

[description]

matrix Float32Array

[description]

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

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

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 735)
Returns:

This WebGLPipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline

setNormalMap(gameObject)

Sets the Game Objects normal map as the active texture.

Parameters:
Name Type Description
gameObject Phaser.GameObjects.GameObject

[description]

Since: 3.11.0
Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 383)

setTexture2D(texture, textureUnit)

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

Parameters:
Name Type Description
texture WebGLTexture

WebGLTexture that will be assigned to the current batch.

textureUnit integer

Texture unit to which the texture needs to be bound.

Since: 3.1.0
Inherited From:
Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 310)
Returns:

This pipeline instance.

Type
Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline

shouldFlush()

Check if the current batch of vertices is full.

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

[description]

Type
boolean