new ForwardDiffuseLightPipeline(config)
Parameters:
| Name | Type | Description |
|---|---|---|
config |
object | The configuration of the pipeline, same as the Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline. The fragment shader will be replaced with the lighting shader. |
- 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
-
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.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
-
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.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
-
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 namestring Name of the vertex attribute
sizeinteger Vertex component size
typeinteger Type of the attribute
normalizedboolean Is the value normalized to a range
offsetinteger 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.
-
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 patharray Collection of points that represent the path.
currentMatrixPhaser.GameObjects.Components.TransformMatrix The current transform.
parentMatrixPhaser.GameObjects.Components.TransformMatrix The parent transform.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1254)
-
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 xnumber Horizontal top left coordinate of the rectangle.
ynumber Vertical top left coordinate of the rectangle.
widthnumber Width of the rectangle.
heightnumber Height of the rectangle.
currentMatrixPhaser.GameObjects.Components.TransformMatrix The current transform.
parentMatrixPhaser.GameObjects.Components.TransformMatrix The parent transform.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1115)
-
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 x0number Point 0 x coordinate.
y0number Point 0 y coordinate.
x1number Point 1 x coordinate.
y1number Point 1 y coordinate.
x2number Point 2 x coordinate.
y2number Point 2 y coordinate.
currentMatrixPhaser.GameObjects.Components.TransformMatrix The current transform.
parentMatrixPhaser.GameObjects.Components.TransformMatrix The parent transform.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1166)
-
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 axnumber X coordinate to the start of the line
aynumber Y coordinate to the start of the line
bxnumber X coordinate to the end of the line
bynumber Y coordinate to the end of the line
aLineWidthnumber Width of the start of the line
bLineWidthnumber Width of the end of the line
currentMatrixFloat32Array Parent matrix, generally used by containers
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1383)
-
batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect [, texture] [, unit])
-
Adds the vertices data into the batch and flushes if full.
Assumes 6 vertices in the following arrangement:
0----3 |\ B| | \ | | \ | | A \| | \ 1----2Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3
Parameters:
Name Type Argument Default Description x0number The top-left x position.
y0number The top-left y position.
x1number The bottom-left x position.
y1number The bottom-left y position.
x2number The bottom-right x position.
y2number The bottom-right y position.
x3number The top-right x position.
y3number The top-right y position.
u0number UV u0 value.
v0number UV v0 value.
u1number UV u1 value.
v1number UV v1 value.
tintTLnumber The top-left tint color value.
tintTRnumber The top-right tint color value.
tintBLnumber The bottom-left tint color value.
tintBRnumber The bottom-right tint color value.
tintEffectnumber | boolean The tint effect for the shader to use.
textureWebGLTexture <optional>
WebGLTexture that will be assigned to the current batch if a flush occurs.
unitinteger <optional>
0 Texture unit to which the texture needs to be bound.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 659)
Returns:
trueif this method caused the batch to flush, otherwisefalse.- Type
- boolean
-
batchSprite(sprite, camera, parentTransformMatrix)
-
Takes a Sprite Game Object, or any object that extends it, which has a normal texture and adds it to the batch.
Parameters:
Name Type Description spritePhaser.GameObjects.Sprite The texture-based Game Object to add to the batch.
cameraPhaser.Cameras.Scene2D.Camera The Camera to use for the rendering transform.
parentTransformMatrixPhaser.GameObjects.Components.TransformMatrix The transform matrix of the parent container, if set.
- Since: 3.0.0
- Overrides:
- Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 474)
-
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
batchLinefor each section of the path.The path is optionally closed at the end.
Parameters:
Name Type Description patharray Collection of points that represent the path.
lineWidthnumber The width of the line segments in pixels.
pathOpenboolean Indicates if the path should be closed or left open.
currentMatrixPhaser.GameObjects.Components.TransformMatrix The current transform.
parentMatrixPhaser.GameObjects.Components.TransformMatrix The parent transform.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1335)
-
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
batchStrokePathmethod.Parameters:
Name Type Description x0number Point 0 x coordinate.
y0number Point 0 y coordinate.
x1number Point 1 x coordinate.
y1number Point 1 y coordinate.
x2number Point 2 x coordinate.
y2number Point 2 y coordinate.
lineWidthnumber The width of the line in pixels.
currentMatrixPhaser.GameObjects.Components.TransformMatrix The current transform.
parentMatrixPhaser.GameObjects.Components.TransformMatrix The parent transform.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1213)
-
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 gameObjectPhaser.GameObjects.GameObject Source GameObject
textureWebGLTexture Raw WebGLTexture associated with the quad
textureWidthinteger Real texture width
textureHeightinteger Real texture height
srcXnumber X coordinate of the quad
srcYnumber Y coordinate of the quad
srcWidthnumber Width of the quad
srcHeightnumber Height of the quad
scaleXnumber X component of scale
scaleYnumber Y component of scale
rotationnumber Rotation of the quad
flipXboolean Indicates if the quad is horizontally flipped
flipYboolean Indicates if the quad is vertically flipped
scrollFactorXnumber By which factor is the quad affected by the camera horizontal scroll
scrollFactorYnumber By which factor is the quad effected by the camera vertical scroll
displayOriginXnumber Horizontal origin in pixels
displayOriginYnumber Vertical origin in pixels
frameXnumber X coordinate of the texture frame
frameYnumber Y coordinate of the texture frame
frameWidthnumber Width of the texture frame
frameHeightnumber Height of the texture frame
tintTLinteger Tint for top left
tintTRinteger Tint for top right
tintBLinteger Tint for bottom left
tintBRinteger Tint for bottom right
tintEffectnumber The tint effect (0 for additive, 1 for replacement)
uOffsetnumber Horizontal offset on texture coordinate
vOffsetnumber Vertical offset on texture coordinate
cameraPhaser.Cameras.Scene2D.Camera Current used camera
parentTransformMatrixPhaser.GameObjects.Components.TransformMatrix Parent container
- Since: 3.0.0
- Overrides:
- Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 180)
-
batchTextureFrame(frame, x, y, tint, alpha, transformMatrix [, parentTransformMatrix])
-
Adds a Texture Frame into the batch for rendering.
Parameters:
Name Type Argument Description framePhaser.Textures.Frame The Texture Frame to be rendered.
xnumber The horizontal position to render the texture at.
ynumber The vertical position to render the texture at.
tintnumber The tint color.
alphanumber The alpha value.
transformMatrixPhaser.GameObjects.Components.TransformMatrix The Transform Matrix to use for the texture.
parentTransformMatrixPhaser.GameObjects.Components.TransformMatrix <optional>
A parent Transform Matrix.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1030)
-
batchTri(x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect [, texture] [, unit])
-
Adds the vertices data into the batch and flushes if full.
Assumes 3 vertices in the following arrangement:
0 |\ | \ | \ | \ | \ 1-----2Parameters:
Name Type Argument Default Description x1number The bottom-left x position.
y1number The bottom-left y position.
x2number The bottom-right x position.
y2number The bottom-right y position.
x3number The top-right x position.
y3number The top-right y position.
u0number UV u0 value.
v0number UV v0 value.
u1number UV u1 value.
v1number UV v1 value.
tintTLnumber The top-left tint color value.
tintTRnumber The top-right tint color value.
tintBLnumber The bottom-left tint color value.
tintEffectnumber | boolean The tint effect for the shader to use.
textureWebGLTexture <optional>
WebGLTexture that will be assigned to the current batch if a flush occurs.
unitinteger <optional>
0 Texture unit to which the texture needs to be bound.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 766)
Returns:
trueif this method caused the batch to flush, otherwisefalse.- 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 319)
Returns:
This WebGLPipeline instance.
-
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()
-
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.
-
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 xnumber Horizontal top left coordinate of the rectangle.
ynumber Vertical top left coordinate of the rectangle.
widthnumber Width of the rectangle.
heightnumber Height of the rectangle.
colornumber Color of the rectangle to draw.
alphanumber Alpha value of the rectangle to draw.
- Since: 3.12.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 1088)
-
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 392)
Returns:
This WebGLPipeline instance.
-
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.
-
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.
-
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.
-
onRender(scene, camera)
-
This function sets all the needed resources for each camera pass.
Parameters:
Name Type Description scenePhaser.Scene The Scene being rendered.
cameraPhaser.Cameras.Scene2D.Camera The Scene Camera being rendered with.
- Since: 3.0.0
- Overrides:
- Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 113)
Returns:
This WebGLPipeline instance.
-
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 textureWebGLTexture Optional WebGLTexture that will be assigned to the created batch.
unitinteger Texture unit to which the texture needs to be bound.
- Since: 3.1.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 356)
-
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 textureWebGLTexture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.
unitinteger Texture unit to which the texture needs to be bound.
- Since: 3.16.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 329)
Returns:
trueif the pipeline needs to create a new batch, otherwisefalse.- Type
- boolean
-
resize(width, height, resolution)
-
Resizes this pipeline and updates the projection.
Parameters:
Name Type Description widthnumber The new width.
heightnumber The new height.
resolutionnumber The resolution.
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 284)
Returns:
This WebGLPipeline instance.
-
setFloat1(name, x)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xnumber The new value of the
floatuniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 476)
Returns:
This WebGLPipeline instance.
-
setFloat1v(name, arr)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
arrFloat32Array 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.
-
setFloat2(name, x, y)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xnumber The new X component of the
vec2uniform.ynumber The new Y component of the
vec2uniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 494)
Returns:
This WebGLPipeline instance.
-
setFloat2v(name, arr)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
arrFloat32Array 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.
-
setFloat3(name, x, y, z)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xnumber The new X component of the
vec3uniform.ynumber The new Y component of the
vec3uniform.znumber The new Z component of the
vec3uniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 513)
Returns:
This WebGLPipeline instance.
-
setFloat3v(name, arr)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
arrFloat32Array 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.
-
setFloat4(name, x, y, z, w)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xnumber X component of the uniform
ynumber Y component of the uniform
znumber Z component of the uniform
wnumber W component of the uniform
- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 533)
Returns:
This WebGLPipeline instance.
-
setFloat4v(name, arr)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
arrFloat32Array 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.
-
setInt1(name, x)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xinteger The new value of the
intuniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 626)
Returns:
This WebGLPipeline instance.
-
setInt2(name, x, y)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xinteger The new X component of the
ivec2uniform.yinteger The new Y component of the
ivec2uniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 644)
Returns:
This WebGLPipeline instance.
-
setInt3(name, x, y, z)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xinteger The new X component of the
ivec3uniform.yinteger The new Y component of the
ivec3uniform.zinteger The new Z component of the
ivec3uniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 663)
Returns:
This WebGLPipeline instance.
-
setInt4(name, x, y, z, w)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
xinteger X component of the uniform
yinteger Y component of the uniform
zinteger Z component of the uniform
winteger W component of the uniform
- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 683)
Returns:
This WebGLPipeline instance.
-
setMatrix2(name, transpose, matrix)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
transposeboolean Whether to transpose the matrix. Should be
false.matrixFloat32Array The new values for the
mat2uniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 704)
Returns:
This WebGLPipeline instance.
-
setMatrix3(name, transpose, matrix)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
transposeboolean Whether to transpose the matrix. Should be
false.matrixFloat32Array The new values for the
mat3uniform.- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 723)
Returns:
This WebGLPipeline instance.
-
setMatrix4(name, transpose, matrix)
-
Set a uniform value of the current pipeline program.
Parameters:
Name Type Description namestring The name of the uniform to look-up and modify.
transposeboolean Should the matrix be transpose
matrixFloat32Array Matrix data
- Since: 3.2.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 742)
Returns:
This WebGLPipeline instance.
-
setNormalMap(gameObject)
-
Sets the Game Objects normal map as the active texture.
Parameters:
Name Type Description gameObjectPhaser.GameObjects.GameObject The Game Object to update.
- Since: 3.11.0
- Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 400)
-
setNormalMapRotation(rotation)
-
Rotates the normal map vectors inversely by the given angle. Only works in 2D space.
Parameters:
Name Type Description rotationnumber The angle of rotation in radians.
- Since: 3.16.0
- Source: src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js (Line 432)
-
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 textureWebGLTexture <optional>
WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.
unitinteger <optional>
0 Texture unit to which the texture needs to be bound.
- Since: 3.1.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/TextureTintPipeline.js (Line 305)
Returns:
This pipeline instance.
-
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:
trueif the current batch should be flushed, otherwisefalse.- Type
- boolean
