new RopePipeline(config)
Parameters:
| Name | Type | Description |
|---|---|---|
config |
Phaser.Types.Renderer.WebGL.WebGLPipelineConfig | The configuration options for this pipeline. |
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/RopePipeline.js (Line 11)
Extends
Members
-
active :boolean
-
Indicates if the current pipeline is active, or not.
Toggle this property to enable or disable a pipeline from rendering anything.
Type:
- boolean
- Since: 3.10.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 225)
-
bytes :Uint8Array
-
Uint8 view to the
vertexDataArrayBuffer. Used for uploading vertex buffer resources to the GPU.Type:
- Uint8Array
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 198)
-
config :Phaser.Types.Renderer.WebGL.WebGLPipelineConfig
-
The configuration object that was used to create this pipeline.
Treat this object as 'read only', because changing it post-creation will not impact this pipeline in any way. However, it is used internally for cloning and post-boot set-up.
Type:
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 353)
-
currentRenderTarget :Phaser.Renderer.WebGL.RenderTarget
-
A reference to the currently bound Render Target instance from the
WebGLPipeline.renderTargetsarray.Type:
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 290)
-
currentShader :Phaser.Renderer.WebGL.WebGLShader
-
A reference to the currently bound WebGLShader instance from the
WebGLPipeline.shadersarray.For lots of pipelines, this is the only shader, so it is a quick way to reference it without an array look-up.
Type:
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 314)
-
currentUnit :number
-
Holds the most recently assigned texture unit.
Treat this value as read-only.
Type:
- number
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 236)
-
forceZero :boolean
-
Some pipelines require the forced use of texture zero (like the light pipeline).
This property should be set when that is the case.
Type:
- boolean
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 247)
-
game :Phaser.Game
-
The Phaser Game instance to which this pipeline is bound.
Type:
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 74)
-
gl :WebGLRenderingContext
-
The WebGL context this WebGL Pipeline uses.
Type:
- WebGLRenderingContext
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 104)
-
<readonly> hasBooted :boolean
-
Indicates if this pipeline has booted or not.
A pipeline boots only when the Game instance itself, and all associated systems, is fully ready.
Type:
- boolean
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 258)
-
height :number
-
Height of the current viewport.
Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 131)
-
<readonly> isPostFX :boolean
-
Indicates if this is a Post FX Pipeline, or not.
Type:
- boolean
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 271)
-
<nullable> manager :Phaser.Renderer.WebGL.PipelineManager
-
A reference to the WebGL Pipeline Manager.
This is initially undefined and only set when this pipeline is added to the manager.
Type:
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 92)
-
name :string
-
Name of the pipeline. Used for identification and setting from Game Objects.
Type:
- string
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 65)
-
projectionHeight :number
-
The cached height of the Projection matrix.
Type:
- number
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 344)
-
projectionMatrix :Phaser.Math.Matrix4
-
The Projection matrix, used by shaders as 'uProjectionMatrix' uniform.
Type:
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 326)
-
projectionWidth :number
-
The cached width of the Projection matrix.
Type:
- number
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 335)
-
renderer :Phaser.Renderer.WebGL.WebGLRenderer
-
The WebGL Renderer instance to which this pipeline is bound.
Type:
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 83)
-
renderTargets :Array.<Phaser.Renderer.WebGL.RenderTarget>
-
An array of RenderTarget instances that belong to this pipeline.
Type:
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 281)
-
shaders :Array.<Phaser.Renderer.WebGL.WebGLShader>
-
An array of all the WebGLShader instances that belong to this pipeline.
Shaders manage their own attributes and uniforms, but share the same vertex data buffer, which belongs to this pipeline.
Shaders are set in a call to the
setShadersFromConfigmethod, which happens automatically, but can also be called at any point in your game. See the method documentation for details.Type:
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 299)
-
topology :GLenum
-
The primitive topology which the pipeline will use to submit draw calls.
Defaults to GL_TRIANGLES if not otherwise set in the config.
Type:
- GLenum
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 187)
-
<readonly> vertexBuffer :WebGLBuffer
-
The WebGLBuffer that holds the vertex data.
Created from the
vertexDataArrayBuffer. Ifverticesare set in the config, aSTATIC_DRAWbuffer is created. If not, aDYNAMIC_DRAWbuffer is created.Type:
- WebGLBuffer
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 174)
-
vertexCapacity :number
-
The total number of vertices that this pipeline batch can hold before it will flush.
This defaults to
renderer batchSize * 6, wherebatchSizeis defined in the Renderer Game Config.Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 150)
-
vertexCount :number
-
The current number of vertices that have been added to the pipeline batch.
Type:
- number
- Since: 3.0.0
- Inherited From:
- Default Value:
-
- 0
- Source: src/renderer/webgl/WebGLPipeline.js (Line 140)
-
<readonly> vertexData :ArrayBuffer
-
Raw byte buffer of vertices.
Either set via the config object
verticesproperty, or generates a new Array Buffer of sizevertexCapacity * vertexSize.Type:
- ArrayBuffer
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 161)
-
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/WebGLPipeline.js (Line 207)
-
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/WebGLPipeline.js (Line 216)
-
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 113)
-
width :number
-
Width of the current viewport.
Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 122)
Methods
-
addListener(event, fn [, context])
-
Add a listener for a given event.
Parameters:
Name Type Argument Default Description eventstring | symbol The event name.
fnfunction The listener function.
context* <optional>
this The context to invoke the listener with.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 111)
Returns:
this. -
batchQuad(gameObject, 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 gameObjectPhaser.GameObjects.GameObject | null The Game Object, if any, drawing this quad.
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.
unitnumber <optional>
0 Texture unit to which the texture needs to be bound.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1261)
Returns:
trueif this method caused the batch to flush, otherwisefalse.- Type
- boolean
-
batchSprite(gameObject, camera [, parentTransformMatrix])
-
Takes a Sprite Game Object, or any object that extends it, and adds it to the batch.
Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.Image | Phaser.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 <optional>
The transform matrix of the parent container, if set.
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/MultiPipeline.js (Line 154)
-
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 [, skipFlip] [, textureUnit])
-
Generic function for batching a textured quad using argument values instead of a Game Object.
Parameters:
Name Type Argument Default Description gameObjectPhaser.GameObjects.GameObject Source GameObject.
textureWebGLTexture Raw WebGLTexture associated with the quad.
textureWidthnumber Real texture width.
textureHeightnumber 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.
tintTLnumber Tint for top left.
tintTRnumber Tint for top right.
tintBLnumber Tint for bottom left.
tintBRnumber Tint for bottom right.
tintEffectnumber The tint effect.
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.
skipFlipboolean <optional>
false Skip the renderTexture check.
textureUnitnumber <optional>
Use the currently bound texture unit?
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/MultiPipeline.js (Line 301)
-
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/MultiPipeline.js (Line 486)
-
batchTri(gameObject, 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 gameObjectPhaser.GameObjects.GameObject | null The Game Object, if any, drawing this quad.
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.
unitnumber <optional>
0 Texture unit to which the texture needs to be bound.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1331)
Returns:
trueif this method caused the batch to flush, otherwisefalse.- Type
- boolean
-
batchVert(x, y, u, v, unit, tintEffect, tint)
-
Adds a single vertex to the current vertex buffer and increments the
vertexCountproperty by 1.This method is called directly by
batchTriandbatchQuad.It does not perform any batch limit checking itself, so if you need to call this method directly, do so in the same way that
batchQuaddoes, for example.Parameters:
Name Type Description xnumber The vertex x position.
ynumber The vertex y position.
unumber UV u value.
vnumber UV v value.
unitnumber Texture unit to which the texture needs to be bound.
tintEffectnumber | boolean The tint effect for the shader to use.
tintnumber The tint color value.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1223)
-
bind()
-
Called every time the pipeline is bound by the renderer. Sets the shader program, vertex buffer and other resources. Should only be called when changing pipeline.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/pipelines/MultiPipeline.js (Line 137)
Returns:
This WebGLPipeline instance.
-
bindRenderTarget( [target] [, unit])
-
Activates the given Render Target texture and binds it to the requested WebGL texture slot.
Parameters:
Name Type Argument Default Description targetPhaser.Renderer.WebGL.RenderTarget <optional>
The Render Target to activate and bind.
unitnumber <optional>
0 The WebGL texture ID to activate. Defaults to
gl.TEXTURE0.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1487)
Returns:
This WebGL Pipeline instance.
-
bindTexture( [target] [, unit])
-
Activates the given WebGL Texture and binds it to the requested texture slot.
Parameters:
Name Type Argument Default Description targetWebGLTexture <optional>
The WebGLTexture to activate and bind.
unitnumber <optional>
0 The WebGL texture ID to activate. Defaults to
gl.TEXTURE0.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1463)
Returns:
This WebGL Pipeline 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. You can perform any final tasks that the pipeline may need, that relies on game systems such as the Texture Manager being ready.
- Since: 3.11.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 367)
Fires:
-
destroy()
-
Destroys all shader instances, removes all object references and nulls all external references.
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 2051)
Fires:
Returns:
This WebGLPipeline instance.
-
drawFillRect(x, y, width, height, color, alpha [, texture] [, flipUV])
-
Pushes a filled rectangle into the vertex batch.
The dimensions are run through
Math.floorbefore the quad is generated.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 Argument Default 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.
textureWebGLTexture <optional>
WebGLTexture that will be assigned to the current batch if a flush occurs.
flipUVboolean <optional>
true Flip the vertical UV coordinates of the texture before rendering?
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1393)
-
emit(event [, args])
-
Calls each of the listeners registered for a given event.
Parameters:
Name Type Argument Description eventstring | symbol The event name.
args* <optional>
<repeatable>
Additional arguments that will be passed to the event handler.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 86)
Returns:
trueif the event had listeners, elsefalse.- Type
- boolean
-
eventNames()
-
Return an array listing the events for which the emitter has registered listeners.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 55)
Returns:
- Type
- Array.<(string|symbol)>
-
flush( [isPostFlush])
-
Uploads the vertex data and emits a draw call for the current batch of vertices.
Parameters:
Name Type Argument Default Description isPostFlushboolean <optional>
false Was this flush invoked as part of a post-process, or not?
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 985)
Fires:
- Phaser.Renderer.WebGL.Pipelines.Events#event:BEFORE_FLUSH
- Phaser.Renderer.WebGL.Pipelines.Events#event:AFTER_FLUSH
Returns:
This WebGLPipeline instance.
-
getShaderByName(name)
-
Searches all shaders in this pipeline for one matching the given name, then returns it.
Parameters:
Name Type Description namestring The index of the shader to set.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 557)
Returns:
The WebGLShader instance, if found.
-
listenerCount(event)
-
Return the number of listeners listening to a given event.
Parameters:
Name Type Description eventstring | symbol The event name.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 75)
Returns:
The number of listeners.
- Type
- number
-
listeners(event)
-
Return the listeners registered for a given event.
Parameters:
Name Type Description eventstring | symbol The event name.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 64)
Returns:
The registered listeners.
- Type
- Array.<function()>
-
off(event [, fn] [, context] [, once])
-
Remove the listeners of a given event.
Parameters:
Name Type Argument Description eventstring | symbol The event name.
fnfunction <optional>
Only remove the listeners that match this function.
context* <optional>
Only remove the listeners that have this context.
onceboolean <optional>
Only remove one-time listeners.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 151)
Returns:
this. -
on(event, fn [, context])
-
Add a listener for a given event.
Parameters:
Name Type Argument Default Description eventstring | symbol The event name.
fnfunction The listener function.
context* <optional>
this The context to invoke the listener with.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 98)
Returns:
this. -
onActive(currentShader)
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called every time the Pipeline Manager makes this the active pipeline. It is called at the end of the
WebGLPipeline.bindmethod, after the current shader has been set. The current shader is passed to this hook.For example, if a display list has 3 Sprites in it that all use the same pipeline, this hook will only be called for the first one, as the 2nd and 3rd Sprites do not cause the pipeline to be changed.
If you need to listen for that event instead, use the
onBindhook.Parameters:
Name Type Description currentShaderPhaser.Renderer.WebGL.WebGLShader The shader that was set as current.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1037)
-
onAfterFlush( [isPostFlush])
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called immediately after this pipeline has finished flushing its batch.
It is called after the
gl.drawArrayscall.You can perform additional post-render effects, but be careful not to call
flushon this pipeline from within this method, or you'll cause an infinite loop.To apply changes pre-render, see
onBeforeFlush.Parameters:
Name Type Argument Default Description isPostFlushboolean <optional>
false Was this flush invoked as part of a post-process, or not?
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1202)
-
onBatch( [gameObject])
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called every time the
batchQuadorbatchTrimethods are called. If this was as a result of a Game Object, then the Game Object reference is passed to this hook too.This hook is called after the quad (or tri) has been added to the batch, so you can safely call 'flush' from within this.
Note that Game Objects may call
batchQuadorbatchTrimultiple times for a single draw, for example the Graphics Game Object.Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject <optional>
The Game Object that invoked this pipeline, if any.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1091)
-
onBeforeFlush( [isPostFlush])
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called every time this pipeline is asked to flush its batch.
It is called immediately before the
gl.bufferDataandgl.drawArrayscalls are made, so you can perform any final pre-render modifications. To apply changes post-render, seeonAfterFlush.Parameters:
Name Type Argument Default Description isPostFlushboolean <optional>
false Was this flush invoked as part of a post-process, or not?
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1185)
-
onBind( [gameObject])
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called every time a Game Object asks the Pipeline Manager to use this pipeline, even if the pipeline is already active.
Unlike the
onActivemethod, which is only called when the Pipeline Manager makes this pipeline active, this hook is called for every Game Object that requests use of this pipeline, allowing you to perform per-object set-up, such as loading shader uniform data.Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject <optional>
The Game Object that invoked this pipeline, if any.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1058)
-
onBoot()
-
This method is called once when this pipeline has finished being set-up at the end of the boot process. By the time this method is called, all of the shaders are ready and configured.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 493)
-
once(event, fn [, context])
-
Add a one-time listener for a given event.
Parameters:
Name Type Argument Default Description eventstring | symbol The event name.
fnfunction The listener function.
context* <optional>
this The context to invoke the listener with.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 124)
Returns:
this. -
onDraw(renderTarget)
-
This method is only used by Post FX Pipelines and those that extend from them.
This method is called every time the
postBatchmethod is called and is passed a reference to the current render target.At the very least a Post FX Pipeline should call
this.bindAndDraw(renderTarget), however, you can do as much additional processing as you like in this method if you override it from within your own pipelines.Parameters:
Name Type Description renderTargetPhaser.Renderer.WebGL.RenderTarget The Render Target.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 951)
-
onPostBatch( [gameObject])
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called immediately after a Game Object has been added to the batch.
Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject <optional>
The Game Object that invoked this pipeline, if any.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1126)
-
onPostRender()
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called once per frame, after all rendering has happened and snapshots have been taken.
It is called at the very end of the rendering process, once all Cameras, for all Scenes, have been rendered.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1170)
-
onPreBatch( [gameObject])
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called immediately before a Game Object is about to add itself to the batch.
Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject <optional>
The Game Object that invoked this pipeline, if any.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1112)
-
onPreRender()
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called once per frame, right before anything has been rendered, but after the canvas has been cleared. If this pipeline has a render target, it will also have been cleared by this point.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1140)
-
onRebind()
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called when the Pipeline Manager needs to rebind this pipeline. This happens after a pipeline has been cleared, usually when passing control over to a 3rd party WebGL library, like Spine, and then returing to Phaser again.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1077)
-
onRender(scene, camera)
-
By default this is an empty method hook that you can override and use in your own custom pipelines.
This method is called once per frame, by every Camera in a Scene that wants to render.
It is called at the start of the rendering process, before anything has been drawn to the Camera.
Parameters:
Name Type Description scenePhaser.Scene The Scene being rendered.
cameraPhaser.Cameras.Scene2D.Camera The Scene Camera being rendered with.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1153)
-
onResize(width, height)
-
This method is called once when this pipeline has finished being set-up at the end of the boot process. By the time this method is called, all of the shaders are ready and configured. It's also called if the renderer changes size.
Parameters:
Name Type Description widthnumber The new width of this WebGL Pipeline.
heightnumber The new height of this WebGL Pipeline.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 505)
-
postBatch( [gameObject])
-
This method is called as a result of the
WebGLPipeline.batchQuadmethod, right after a quad belonging to a Game Object has been added to the batch. When this is called, the renderer has just performed a flush.It calls the
onDrawhook followed by theonPostBatchhook, which can be used to perform additional Post FX Pipeline processing.Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject | Phaser.Cameras.Scene2D.Camera <optional>
The Game Object or Camera that invoked this pipeline, if any.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 927)
Returns:
This WebGLPipeline instance.
-
preBatch( [gameObject])
-
This method is called as a result of the
WebGLPipeline.batchQuadmethod, right before a quad belonging to a Game Object is about to be added to the batch. When this is called, the renderer has just performed a flush. It will bind the current render target, if any are set and finally call theonPreBatchhook.Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject | Phaser.Cameras.Scene2D.Camera <optional>
The Game Object or Camera that invoked this pipeline, if any.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 902)
Returns:
This WebGLPipeline instance.
-
rebind()
-
This method is called every time the Pipeline Manager rebinds this pipeline.
It resets all shaders this pipeline uses, setting their attributes again.
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 844)
Fires:
Returns:
This WebGLPipeline instance.
-
removeAllListeners( [event])
-
Remove all listeners, or those of the specified event.
Parameters:
Name Type Argument Description eventstring | symbol <optional>
The event name.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 165)
Returns:
this. -
removeListener(event [, fn] [, context] [, once])
-
Remove the listeners of a given event.
Parameters:
Name Type Argument Description eventstring | symbol The event name.
fnfunction <optional>
Only remove the listeners that match this function.
context* <optional>
Only remove the listeners that have this context.
onceboolean <optional>
Only remove one-time listeners.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 137)
Returns:
this. -
resize(width, height)
-
Resizes the properties used to describe the viewport.
This method is called automatically by the renderer during its resize handler.
Parameters:
Name Type Description widthnumber The new width of this WebGL Pipeline.
heightnumber The new height of this WebGL Pipeline.
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 701)
Fires:
Returns:
This WebGLPipeline instance.
-
set1f(name, x [, shader])
-
Sets a 1f uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber The new value of the
floatuniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1523)
Returns:
This WebGLPipeline instance.
-
set1fv(name, arr [, shader])
-
Sets a 1fv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1637)
Returns:
This WebGLPipeline instance.
-
set1i(name, x [, shader])
-
Sets a 1i uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber The new value of the
intuniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1853)
Returns:
This WebGLPipeline instance.
-
set1iv(name, arr [, shader])
-
Sets a 1iv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1745)
Returns:
This WebGLPipeline instance.
-
set2f(name, x, y [, shader])
-
Sets a 2f uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber The new X component of the
vec2uniform.ynumber The new Y component of the
vec2uniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1550)
Returns:
This WebGLPipeline instance.
-
set2fv(name, arr [, shader])
-
Sets a 2fv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1664)
Returns:
This WebGLPipeline instance.
-
set2i(name, x, y [, shader])
-
Sets a 2i uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber The new X component of the
ivec2uniform.ynumber The new Y component of the
ivec2uniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1880)
Returns:
This WebGLPipeline instance.
-
set2iv(name, arr [, shader])
-
Sets a 2iv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1772)
Returns:
This WebGLPipeline instance.
-
set3f(name, x, y, z [, shader])
-
Sets a 3f uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber The new X component of the
vec3uniform.ynumber The new Y component of the
vec3uniform.znumber The new Z component of the
vec3uniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1578)
Returns:
This WebGLPipeline instance.
-
set3fv(name, arr [, shader])
-
Sets a 3fv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1691)
Returns:
This WebGLPipeline instance.
-
set3i(name, x, y, z [, shader])
-
Sets a 3i uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber The new X component of the
ivec3uniform.ynumber The new Y component of the
ivec3uniform.znumber The new Z component of the
ivec3uniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1908)
Returns:
This WebGLPipeline instance.
-
set3iv(name, arr [, shader])
-
Sets a 3iv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1799)
Returns:
This WebGLPipeline instance.
-
set4f(name, x, y, z, w [, shader])
-
Sets a 4f uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber X component of the uniform
ynumber Y component of the uniform
znumber Z component of the uniform
wnumber W component of the uniform
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1607)
Returns:
This WebGLPipeline instance.
-
set4fv(name, arr [, shader])
-
Sets a 4fv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1718)
Returns:
This WebGLPipeline instance.
-
set4i(name, x, y, z, w [, shader])
-
Sets a 4i uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
xnumber X component of the uniform.
ynumber Y component of the uniform.
znumber Z component of the uniform.
wnumber W component of the uniform.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1937)
Returns:
This WebGLPipeline instance.
-
set4iv(name, arr [, shader])
-
Sets a 4iv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
arrArray.<number> | Float32Array The new value to be used for the uniform variable.
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1826)
Returns:
This WebGLPipeline instance.
-
setGameObject(gameObject [, frame])
-
Custom pipelines can use this method in order to perform any required pre-batch tasks for the given Game Object. It must return the texture unit the Game Object was assigned.
Parameters:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject The Game Object being rendered or added to the batch.
framePhaser.Textures.Frame <optional>
Optional frame to use. Can override that of the Game Object.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 659)
Returns:
The texture unit the Game Object has been assigned.
- Type
- number
-
setMatrix2fv(name, transpose, matrix [, shader])
-
Sets a matrix 2fv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
transposeboolean Whether to transpose the matrix. Should be
false.matrixArray.<number> | Float32Array The new values for the
mat2uniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1967)
Returns:
This WebGLPipeline instance.
-
setMatrix3fv(name, transpose, matrix [, shader])
-
Sets a matrix 3fv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
transposeboolean Whether to transpose the matrix. Should be
false.matrixFloat32Array The new values for the
mat3uniform.shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1995)
Returns:
This WebGLPipeline instance.
-
setMatrix4fv(name, transpose, matrix [, shader])
-
Sets a matrix 4fv uniform value based on the given name on the currently set shader.
The current shader is bound, before the uniform is set, making it active within the WebGLRenderer. This means you can safely call this method from a location such as a Scene
createorupdatemethod. However, when working within a Shader file directly, use theWebGLShadermethod equivalent instead, to avoid the program being set.Parameters:
Name Type Argument Description namestring The name of the uniform to set.
transposeboolean Should the matrix be transpose
matrixFloat32Array Matrix data
shaderPhaser.Renderer.WebGL.WebGLShader <optional>
The shader to set the value on. If not given, the
currentShaderis used.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 2023)
Returns:
This WebGLPipeline instance.
-
setProjectionMatrix(width, height)
-
Adjusts this pipelines ortho Projection Matrix to use the given dimensions and resets the
uProjectionMatrixuniform on all bound shaders.This method is called automatically by the renderer during its resize handler.
Parameters:
Name Type Description widthnumber The new width of this WebGL Pipeline.
heightnumber The new height of this WebGL Pipeline.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 741)
Returns:
This WebGLPipeline instance.
-
setShader(shader [, setAttributes])
-
Sets the currently active shader within this pipeline.
Parameters:
Name Type Argument Default Description shaderPhaser.Renderer.WebGL.WebGLShader The shader to set as being current.
setAttributesboolean <optional>
false Should the vertex attribute pointers be set?
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 521)
Returns:
This WebGLPipeline instance.
-
setShadersFromConfig(config)
-
Destroys all shaders currently set in the
WebGLPipeline.shadersarray and then parses the givenconfigobject, extracting the shaders from it, creatingWebGLShaderinstances and finally setting them into theshadersarray of this pipeline.This is a destructive process. Be very careful when you call it, should you need to.
Parameters:
Name Type Description configPhaser.Types.Renderer.WebGL.WebGLPipelineConfig The configuration object for this WebGL Pipeline.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 580)
Returns:
This WebGLPipeline instance.
-
setTexture2D( [texture])
-
Sets the texture to be bound to the next available texture unit and returns the unit id.
Parameters:
Name Type Argument Description textureWebGLTexture <optional>
WebGLTexture that will be assigned to the current batch. If not given uses
whiteTexture.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1443)
Returns:
The assigned texture unit.
- Type
- number
-
setTime(name)
-
Sets the current duration into a 1f uniform value based on the given name.
This can be used for mapping time uniform values, such as
iTime.Parameters:
Name Type Description namestring The name of the uniform to set.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 1504)
Returns:
This WebGLPipeline instance.
-
setVertexBuffer()
-
Binds the vertex buffer to be the active ARRAY_BUFFER on the WebGL context.
It first checks to see if it's already set as the active buffer and only binds itself if not.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 876)
Returns:
trueif the vertex buffer was bound, orfalseif it was already bound.- Type
- boolean
-
shouldFlush( [amount])
-
Check if the current batch of vertices is full.
You can optionally provide an
amountparameter. If given, it will check if the batch needs to flush if theamountis added to it. This allows you to test if you should flush before populating the batch.Parameters:
Name Type Argument Default Description amountnumber <optional>
0 Will the batch need to flush if this many vertices are added to it?
- Since: 3.0.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 680)
Returns:
trueif the current batch should be flushed, otherwisefalse.- Type
- boolean
-
shutdown()
-
Removes all listeners.
- Since: 3.0.0
- Inherited From:
- Source: src/events/EventEmitter.js (Line 31)
-
unbind()
-
This method is called every time the Pipeline Manager deactivates this pipeline, swapping from it to another one. This happens after a call to
flushand before the new pipeline is bound.- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 970)
-
updateProjectionMatrix()
-
Adjusts this pipelines ortho Projection Matrix to match that of the global WebGL Renderer Projection Matrix.
This method is called automatically by the Pipeline Manager when this pipeline is set.
- Since: 3.50.0
- Inherited From:
- Source: src/renderer/webgl/WebGLPipeline.js (Line 789)
