Types.Renderer.WebGL
ShaderAdditionConfig
<static> ShaderAdditionConfig
A ShaderAdditionConfig defines an addition to be made to a shader program.
It consists of a name, a set of shader additions, and optional tags.
The name is used as a key to identify the shader addition.
It is used as part of a unique identifier for a shader program.
The shader additions are key-value pairs of strings,
where the key is the template to which the value is added.
This is found in the base shader program source code as
#pragma phaserTemplate(key).
| name | type | optional | description |
|---|---|---|---|
| name | string | No | The name of the shader addition, used as a key. |
| additions | object | No | The shader additions to apply. Each addition is a key-value pair of strings, where the key is the template to which the value is added. Keys are applied to both vertex and fragment shader code, if the template exists in both. |
| tags | Array.<string> | Yes | Optional tags used to describe the shader addition. |
| disable | boolean | Yes | Whether to ignore this addition while compiling a shader. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/ShaderAdditionConfig.js#L7
Since: 4.0.0
WebGLAttributeLayout
<static> WebGLAttributeLayout
| name | type | optional | default | description |
|---|---|---|---|---|
| name | string | No | The name of the attribute, as defined in the shader. | |
| size | number | No | The number of components per vertex attribute. | |
| type | GLenum | string | No | The data type of each component in the array. This can differ from the type in the shader, so long as WebGL can convert the types. If the type is a string, it will be converted to the appropriate GLenum, e.g. 'FLOAT' to gl.FLOAT. | |
| normalized | boolean | No | Whether integer data values should be normalized when being cast to a float. | |
| offset | number | No | The byte offset from the beginning of the buffer. | |
| bytes | number | Yes | 4 | The number of bytes per vertex attribute. This is the size of the type, usually 4 bytes for FLOAT or INT. |
| columns | number | Yes | 1 | The number of columns in the attribute data. Represent matrices as column vectors and increase columns to match the matrix size. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLAttributeBufferLayout.js#L7
Since: 4.0.0
WebGLAttributeBufferLayout
<static> WebGLAttributeBufferLayout
| name | type | optional | description |
|---|---|---|---|
| stride | number | No | The stride of the attribute data. |
| count | number | No | The maximum number of elements in the buffer. |
| usage | GLenum | string | No | The usage pattern of the data store. gl.STATIC_DRAW, gl.DYNAMIC_DRAW or gl.STREAM_DRAW. If the type is a string, it will be converted to the appropriate GLenum, e.g. 'STATIC_DRAW' to gl.STATIC_DRAW. |
| instanceDivisor | number | Yes | The instance divisor of the attribute data. This is how many vertices to draw before moving to the next one. It is only used for instanced rendering. |
| layout | Phaser.Types.Renderer.WebGL.WebGLAttributeLayout | No | The layout of the attribute data. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLAttributeBufferLayout.js#L20
Since: 4.0.0
WebGLBatchEntry
<static> WebGLBatchEntry
| name | type | optional | description |
|---|---|---|---|
| start | number | No | The vertex count this batch entry starts from. |
| count | number | No | The total number of vertices in this batch entry. |
| unit | number | No | The current texture unit of the batch entry. |
| maxUnit | number | No | The maximum number of texture units in this batch entry. |
| texture | Array.<Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper> | No | An array of WebGLTextureWrapper references used in this batch entry. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLBatchEntry.js#L1
Since: 4.0.0
WebGLBlendParameters
<static> WebGLBlendParameters
| name | type | optional | description |
|---|---|---|---|
| enabled | GLboolean | Yes | Whether blending is enabled. |
| color | Array.<GLclampf> | Yes | The blend color (RGBA, 0-1). |
| equation | Array.<GLenum> | Yes | The blend equation. The first value is the RGB equation and the second is the alpha equation. |
| func | Array.<GLenum> | Yes | The blend function. The values are srcRGB, dstRGB, srcAlpha, dstAlpha. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLBlendParameters.js#L7
Since: 4.0.0
WebGLConst
<static> WebGLConst
| name | type | optional | description |
|---|---|---|---|
| enum | GLenum | No | The data type of the attribute, i.e. gl.BYTE, gl.SHORT, gl.UNSIGNED_BYTE, gl.FLOAT, etc. |
| size | number | No | The size, in bytes, of the data type. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLConst.js#L1
Since: 3.50.0
WebGLGlobalParameters
<static> WebGLGlobalParameters
| name | type | optional | description |
|---|---|---|---|
| bindings | object | Yes | Resources to be bound. |
| bindings.activeTexture | GLint | Yes | The active texture unit. |
| bindings.arrayBuffer | Phaser.Renderer.WebGL.Wrappers.WebGLBufferWrapper | Yes | The vertex array buffer to bind. |
| bindings.elementArrayBuffer | Phaser.Renderer.WebGL.Wrappers.WebGLBufferWrapper | Yes | The index array buffer to bind. |
| bindings.framebuffer | Phaser.Renderer.WebGL.Wrappers.WebGLFramebufferWrapper | Yes | The framebuffer to bind. |
| bindings.program | Phaser.Renderer.WebGL.Wrappers.WebGLProgramWrapper | Yes | The program to bind. |
| bindings.renderbuffer | WebGLRenderbuffer | Yes | The renderbuffer to bind. |
| blend | Phaser.Types.Renderer.WebGL.WebGLBlendParameters | Yes | The blend parameters to set. |
| colorClearValue | Array.<Float32Array> | Yes | The color to clear the color buffer to. 4 elements, RGBA. |
| colorWritemask | Array.<GLboolean> | Yes | The color writemask to set. 4 elements, RGBA. |
| cullFace | boolean | Yes | Whether to enable culling. |
| depthTest | boolean | Yes | Whether to enable depth testing. |
| scissor | object | Yes | Scissor parameters to set. |
| scissor.enable | boolean | Yes | Whether to enable scissoring. |
| scissor.box | Array.<Int32Array> | Yes | The scissor rectangle to set. 4 elements, XYWH. Note that these are stored in WebGL format, bottom-up, so the Y coordinate is inverted to screen space. |
| stencil | Phaser.Types.Renderer.WebGL.WebGLStencilParameters | Yes | The stencil parameters to set. |
| texturing | object | Yes | Texture settings to set. These take effect when creating a texture. |
| texturing.flipY | GLboolean | Yes | Should the texture be flipped on the Y axis? |
| texturing.premultiplyAlpha | GLboolean | Yes | Should the texture be pre-multiplied alpha? |
| vao | Phaser.Renderer.WebGL.Wrappers.WebGLVAOWrapper | Yes | Vertex Array Object to bind. This controls the vertex attribute state. |
| viewport | Array.<Int32Array> | Yes | The viewport to set. 4 elements, XYWH. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLGlobalParameters.js#L7
Since: 4.0.0
WebGLStencilParameters
<static> WebGLStencilParameters
| name | type | optional | description |
|---|---|---|---|
| enabled | GLboolean | Yes | Whether stencil testing is enabled. |
| func | object | Yes | Stencil function parameters. |
| func.func | GLenum | No | The comparison function. |
| func.ref | GLint | No | The reference value for the stencil test. |
| func.mask | GLuint | No | The mask to apply to the stencil test. |
| op | object | Yes | Stencil operation parameters. |
| op.fail | GLenum | No | The operation to perform if the stencil test fails. |
| op.zfail | GLenum | No | The operation to perform if the depth test fails. |
| op.zpass | GLenum | No | The operation to perform if the stencil test passes and the depth test passes or is disabled. |
| clear | GLint | Yes | The value to clear the stencil buffer to. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLStencilParameters.js#L7
Since: 4.0.0
WebGLTextureCompression
<static> WebGLTextureCompression
| name | type | optional | description |
|---|---|---|---|
| ASTC | object | undefined | No | Indicates if ASTC compression is supported (mostly iOS). |
| ATC | object | undefined | No | Indicates if ATC compression is supported. |
| BPTC | object | undefined | No | Indicates if BPTC compression is supported. |
| ETC | object | undefined | No | Indicates if ETC compression is supported (mostly Android). |
| ETC1 | object | undefined | No | Indicates if ETC1 compression is supported (mostly Android). |
| IMG | object | undefined | No | Indicates the browser supports true color images (all browsers). |
| PVRTC | object | undefined | No | Indicates if PVRTC compression is supported (mostly iOS). |
| RGTC | object | undefined | No | Indicates if RGTC compression is supported (mostly iOS). |
| S3TC | object | undefined | No | Indicates if S3TC compression is supported on current device (mostly Windows). |
| S3TCSRGB | object | undefined | No | Indicates if S3TCSRGB compression is supported on current device (mostly Windows). |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLTextureCompression.js#L1
Since: 3.55.0
WebGLUniform
<static> WebGLUniform
| name | type | optional | description |
|---|---|---|---|
| location | GLint | No | The location of the uniform. |
| type | GLenum | No | The type of the uniform. |
| size | GLint | No | The size of the uniform, in elements. |
| value | number | Array.<number> | No | The value of the uniform. |
Type: object
Member of: Phaser.Types.Renderer.WebGL
Source: src/renderer/webgl/typedefs/WebGLUniform.js#L7
Since: 4.0.0