Skip to main content
Version: Phaser v3.88.2

MobilePipeline

The Mobile Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL

when the device running the game is detected to be a mobile.

You can control the use of this pipeline by setting the Game Configuration

property autoMobilePipeline. If set to false then all devices will use

the Multi Tint Pipeline. You can also call the PipelineManager.setDefaultPipeline

method at run-time, rather than boot-time, to modify the default Game Object

pipeline.

Virtually all Game Objects use this pipeline by default, including Sprites, Graphics

and Tilemaps. It handles the batching of quads and tris, as well as methods for

drawing and batching geometry data.

The fragment shader it uses can be found in shaders/src/Mobile.frag.

The vertex shader it uses can be found in shaders/src/Mobile.vert.

The default shader attributes for this pipeline are:

inPosition (vec2, offset 0)

inTexCoord (vec2, offset 8)

inTexId (float, offset 16)

inTintEffect (float, offset 20)

inTint (vec4, offset 24, normalized)

Note that inTexId isn't used in the shader, it's just kept to allow us

to piggy-back on the Multi Tint Pipeline functions.

The default shader uniforms for this pipeline are:

uProjectionMatrix (mat4)

uResolution (vec2)

uMainSampler (sampler2D, or sampler2D array)

Constructor

new MobilePipeline(config)

Parameters

nametypeoptionaldescription
configPhaser.Types.Renderer.WebGL.WebGLPipelineConfigNoThe configuration options for this pipeline.

Scope: static

Extends

Phaser.Renderer.WebGL.Pipelines.MultiPipeline

Source: src/renderer/webgl/pipelines/MobilePipeline.js#L15
Since: 3.60.0

Inherited Methods

From Phaser.Events.EventEmitter:

From Phaser.Renderer.WebGL.Pipelines.MultiPipeline:

From Phaser.Renderer.WebGL.WebGLPipeline:


Public Methods

boot

<instance> boot()

Description:

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.

Overrides: Phaser.Renderer.WebGL.Pipelines.MultiPipeline#boot

Source: src/renderer/webgl/pipelines/MobilePipeline.js#L96
Since: 3.60.0


Inherited Members

From Phaser.Renderer.WebGL.Pipelines.MultiPipeline:

From Phaser.Renderer.WebGL.WebGLPipeline: