new BitmapMaskPipeline(config)
Parameters:
Name | Type | Description |
---|---|---|
config |
object | Used for overriding shader an pipeline properties if extending this pipeline. |
- Since: 3.0.0
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 13)
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)
-
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 :number
-
Size of the batch.
Type:
- number
- Since: 3.0.0
- Default Value:
-
- 1
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 79)
-
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)
-
resolutionDirty :boolean
-
Dirty flag to check if resolution properties need to be updated on the masking shader.
Type:
- boolean
- Since: 3.0.0
- Default Value:
-
- true
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 89)
-
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
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 70)
-
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.
-
beginMask(mask, maskedObject, camera)
-
Binds necessary resources and renders the mask to a separated framebuffer. The framebuffer for the masked object is also bound for further use.
Parameters:
Name Type Description mask
Phaser.GameObjects.GameObject GameObject used as mask.
maskedObject
Phaser.GameObjects.GameObject GameObject masked by the mask GameObject.
camera
Phaser.Cameras.Scene2D.Camera The camera rendering the current mask.
- Since: 3.0.0
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 149)
-
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:
- 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.
-
endMask(mask)
-
The masked game objects framebuffer is unbound and its texture is bound together with the mask texture and the mask shader and a draw call with a single quad is processed. Here is where the masking effect is applied.
Parameters:
Name Type Description mask
Phaser.GameObjects.GameObject GameObject used as a mask.
- Since: 3.0.0
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 190)
-
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/WebGLPipeline.js (Line 419)
Returns:
This WebGLPipeline instance.
-
onBind()
-
Called every time the pipeline needs to be used. It binds all necessary resources.
- Since: 3.0.0
- Overrides:
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 101)
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)
-
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.
-
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
- Overrides:
- Source: src/renderer/webgl/pipelines/BitmapMaskPipeline.js (Line 128)
Returns:
This WebGLPipeline instance.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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, otherwisefalse
.- Type
- boolean