- Source: src/renderer/webgl/typedefs/index.js (Line 7)
Type Definitions
-
RenderTargetConfig
-
Type:
- object
- Since: 3.50.0
- Source: src/renderer/webgl/typedefs/RenderTargetConfig.js (Line 1)
Properties:
Name Type Argument Default Description scalenumber <optional>
1 A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc.
minFilternumber <optional>
0 The minFilter mode of the texture. 0 is
LINEAR, 1 isNEAREST.autoClearboolean <optional>
true Controls if this Render Target is automatically cleared (via
gl.COLOR_BUFFER_BIT) during the bind. -
WebGLConst
-
Type:
- object
- Since: 3.50.0
- Source: src/renderer/webgl/typedefs/WebGLConst.js (Line 1)
Properties:
Name Type Description enumGLenum The data type of the attribute, i.e.
gl.BYTE,gl.SHORT,gl.UNSIGNED_BYTE,gl.FLOAT, etc.sizenumber The size, in bytes, of the data type.
-
WebGLPipelineAttribute
-
Type:
- object
- Since: 3.50.0
- Source: src/renderer/webgl/typedefs/WebGLPipelineAttribute.js (Line 1)
Properties:
Name Type Description namestring The name of the attribute as defined in the vertex shader.
sizenumber The number of components in the attribute, i.e. 1 for a float, 2 for a vec2, 3 for a vec3, etc.
typeGLenum The data type of the attribute. Either
gl.BYTE,gl.SHORT,gl.UNSIGNED_BYTE,gl.UNSIGNED_SHORTorgl.FLOAT.offsetnumber The offset, in bytes, of this attribute data in the vertex array. Equivalent to
offsetof(vertex, attrib)in C.normalizedboolean Should the attribute data be normalized?
enabledboolean You should set this to
falseby default. The pipeline will enable it on boot.locationnumber You should set this to
-1by default. The pipeline will set it on boot. -
WebGLPipelineAttributesConfig
-
Type:
- object
- Since: 3.50.0
- Source: src/renderer/webgl/typedefs/WebGLPipelineAttributesConfig.js (Line 1)
Properties:
Name Type Argument Default Description namestring The name of the attribute as defined in the vertex shader.
sizenumber The number of components in the attribute, i.e. 1 for a float, 2 for a vec2, 3 for a vec3, etc.
typePhaser.Types.Renderer.WebGL.WebGLConst The data type of the attribute, one of the
WEBGL_CONSTvalues, i.e.WEBGL_CONST.FLOAT,WEBGL_CONST.UNSIGNED_BYTE, etc.normalizedboolean <optional>
false Should the attribute data be normalized?
-
WebGLPipelineConfig
-
Type:
- object
- Since: 3.50.0
- Source: src/renderer/webgl/typedefs/WebGLPipelineConfig.js (Line 1)
Properties:
Name Type Argument Default Description gamePhaser.Game The Phaser.Game instance that owns this pipeline.
namestring <optional>
The name of the pipeline.
topologyGLenum <optional>
gl.TRIANGLES How the primitives are rendered. The default value is GL_TRIANGLES. Here is the full list of rendering primitives: (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants).
vertShaderstring <optional>
The source code, as a string, for the vertex shader. If you need to assign multiple shaders, see the
shadersproperty.fragShaderstring <optional>
The source code, as a string, for the fragment shader. Can include
%count%and%forloop%declarations for multi-texture support. If you need to assign multiple shaders, see theshadersproperty.batchSizenumber <optional>
The number of quads to hold in the batch. Defaults to
RenderConfig.batchSize. This amount * 6 gives the vertex capacity.vertexSizenumber <optional>
The size, in bytes, of a single entry in the vertex buffer. Defaults to Float32Array.BYTES_PER_ELEMENT * 6 + Uint8Array.BYTES_PER_ELEMENT * 4.
verticesArray.<number> | Float32Array <optional>
An optional Array or Typed Array of pre-calculated vertices data that is copied into the vertex data.
attributesPhaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig <optional>
An array of shader attribute data. All shaders bound to this pipeline must use the same attributes.
shadersArray.<Phaser.Types.Renderer.WebGL.WebGLPipelineShaderConfig> <optional>
An array of shaders, all of which are created for this one pipeline. Uses the
vertShader,fragShader,attributesanduniformsproperties of this object as defaults.forceZeroboolean <optional>
false Force the shader to use just a single sampler2d? Set for anything that extends the Single Pipeline.
renderTargetboolean | number | Array.<Phaser.Types.Renderer.WebGL.RenderTargetConfig> <optional>
Create Render Targets for this pipeline. Can be a number, which determines the quantity, a boolean (sets quantity to 1), or an array of Render Target configuration objects.
-
WebGLPipelineShaderConfig
-
Type:
- object
- Since: 3.50.0
- Source: src/renderer/webgl/typedefs/WebGLPipelineShaderConfig.js (Line 1)
Properties:
Name Type Argument Description namestring <optional>
The name of the shader. Doesn't have to be unique, but makes shader look-up easier if it is.
vertShaderstring <optional>
The source code, as a string, for the vertex shader. If not given, uses the
Phaser.Types.Renderer.WebGL.WebGLPipelineConfig.vertShaderproperty instead.fragShaderstring <optional>
The source code, as a string, for the fragment shader. Can include
%count%and%forloop%declarations for multi-texture support. If not given, uses thePhaser.Types.Renderer.WebGL.WebGLPipelineConfig.fragShaderproperty instead.attributesPhaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig <optional>
An array of shader attribute data. All shaders bound to this pipeline must use the same attributes.
-
WebGLPipelineUniformsConfig
-
Type:
- object
- Since: 3.50.0
- Source: src/renderer/webgl/typedefs/WebGLPipelineUniformsConfig.js (Line 1)
Properties:
Name Type Description namestring The name of the uniform as defined in the shaders.
locationWebGLUniformLocation The pipeline will set it when the program is linked.
value1any The cached value1.
value2any The cached value2.
value3any The cached value3.
value4any The cached value4.
