Types.Renderer.WebGL.RenderNodes
SubmitterSpriteGPULayerConfig
<static> SubmitterSpriteGPULayerConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| name | string | Yes | "'SubmitterSpriteGPULayer'" | The name of the RenderNode. This should be unique within the manager. |
| vertexSource | string | Yes | The vertex shader source code. If not provided, a default quad shader will be used. | |
| fragmentSource | string | Yes | The fragment shader source code. If not provided, a default quad shader will be used. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/renderNodes/submitter/typedefs/SubmitterSpriteGPULayerConfig.js#L7
Since: 4.0.0
BatchHandlerConfig
<static> BatchHandlerConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| name | string | No | The name of the RenderNode. This should be unique within the manager. | |
| instancesPerBatch | number | Yes | The number of instances per batch. Instances are usually quads. This factors into the size of the vertex buffer. The default is based on 16-bit vertex indices, which allows for 65535 vertices. This is divided by verticesPerInstance to get the number of instances. Note that no larger number of vertices is possible with 16-bit indices. | |
| verticesPerInstance | number | Yes | 4 | The number of unique vertices per instance. This is usually 4 for a quad. |
| indicesPerInstance | number | Yes | 6 | The number of indices per instance. This is used to populate and advance the element buffer. Default quads use 6 indices in the TRIANGLE_STRIP pattern [0, 0, 1, 2, 3, 3] to connect independent quads with degenerate topology. The minimum number is 3. |
| maxTexturesPerBatch | number | Yes | The maximum number of textures per batch entry. This defaults to the maximum number of textures supported by the renderer. It is used to compile the shader program. At runtime, the manager may suggest a different number, which is interpreted by the node's updateTextureCount method. | |
| indexBufferDynamic | boolean | Yes | false | Whether the index buffer should be created as a dynamic buffer. This is useful for handlers that need to change the index data frequently. |
| shaderName | string | Yes | The base name to use for the shader program. | |
| vertexSource | string | Yes | The vertex shader source code. If not provided, a default quad shader will be used. | |
| fragmentSource | string | Yes | The fragment shader source code. If not provided, a default quad shader will be used. | |
| shaderAdditions | Array.<Phaser.Types.Renderer.WebGL.ShaderAdditionConfig> | Yes | An array of shader additions to apply to the shader program. | |
| shaderFeatures | Array.<string> | Yes | An array of shader features to enable in the shader program. | |
| vertexBufferLayout | Phaser.Types.Renderer.WebGL.WebGLAttributeBufferLayout | any | Yes | The vertex buffer layout for the batch handler. If not provided, a default quad layout will be used. The count property will be determined by the instancesPerBatch and verticesPerInstance properties. The location and bytes properties of each attribute will be determined automatically during initialization. You may provide a Partial WebGLAttributeBufferLayout, which will be filled in automatically during initialization. | |
| vertexBufferLayoutRemove | Array.<string> | Yes | An array of attribute names to remove from the vertex buffer layout. This is useful for removing attributes that are not used by the shader program. | |
| vertexBufferLayoutAdd | Array.<(Phaser.Types.Renderer.WebGL.WebGLAttributeLayout | any)> | Yes | An array of additional attribute layouts to add to the vertex buffer layout. This is useful for adding attributes to the default shader program. You may provide a Partial WebGLAttributeLayout, which will be filled in automatically during initialization. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/renderNodes/typedefs/BatchHandlerConfig.js#L7
Since: 4.0.0
BatchHandlerQuadRenderOptionsSelfShadow
<static> BatchHandlerQuadRenderOptionsSelfShadow
Self-shadowing options for quad rendering.
| name | type | optional | description |
|---|---|---|---|
| enabled | boolean | No | Whether to use self-shadowing. |
| penumbra | number | No | Self-shadowing penumbra strength. |
| diffuseFlatThreshold | number | No | Self-shadowing texture brightness equivalent to a flat surface. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/renderNodes/typedefs/BatchHandlerQuadRenderOptions.js#L7
Since: 4.0.0
BatchHandlerQuadRenderOptionsLighting
<static> BatchHandlerQuadRenderOptionsLighting
Lighting options for quad rendering.
| name | type | optional | description |
|---|---|---|---|
| normalGLTexture | Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper | No | The normal map texture to render. |
| normalMapRotation | number | No | The rotation of the normal map texture. |
| selfShadow | Phaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerQuadRenderOptionsSelfShadow | Yes | Self-shadowing options. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/renderNodes/typedefs/BatchHandlerQuadRenderOptions.js#L18
Since: 4.0.0
BatchHandlerQuadRenderOptions
<static> BatchHandlerQuadRenderOptions
Options to configure shader capabilities for quad rendering.
| name | type | optional | description |
|---|---|---|---|
| multiTexturing | boolean | Yes | Whether to use multi-texturing. |
| lighting | Phaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerQuadRenderOptionsLighting | Yes | How to treat lighting. If this object is defined, lighting will be activated, and multi-texturing disabled. |
| smoothPixelArt | boolean | Yes | Whether to use the smooth pixel art algorithm. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/renderNodes/typedefs/BatchHandlerQuadRenderOptions.js#L29
Since: 4.0.0
GameObjectBatcherConfig
<static> GameObjectBatcherConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| name | string | No | The name of the RenderNode. This should be unique within the manager. | |
| batchHandler | string | Phaser.Renderer.WebGL.RenderNodes.BatchHandler | Yes | "'BatchHandlerQuad'" | The batch handler to which this node will send vertex information. The batch handler will be added to the manager if necessary. This is invoked during run. It is where shader configuration should be done. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/renderNodes/typedefs/GameObjectBatcherConfig.js#L7
Since: 4.0.0
SubmitterQuadConfig
<static> SubmitterQuadConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| name | string | Yes | "'SubmitterQuad'" | The name of this RenderNode. |
| role | string | Yes | "'Submitter'" | The expected role of this RenderNode. |
| batchHandler | string | Yes | "'BatchHandler'" | The key of the default batch handler node to use for this RenderNode. This should correspond to a node which extends BatchHandlerQuad. It will be derived from the game object whenever the node runs. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/renderNodes/typedefs/SubmitterQuadConfig.js#L7
Since: 4.0.0
DrawingContextOptions
<static> DrawingContextOptions
Configuration settings for a DrawingContext.
| name | type | optional | default | description |
|---|---|---|---|---|
| autoClear | boolean | Array.<boolean> | Yes | true | Whether to automatically clear the framebuffer when the context comes into use. If an array, the elements are whether to clear the color, depth, and stencil buffers respectively. |
| blendMode | number | Yes | 0 | The blend mode to use when rendering. |
| camera | Phaser.Cameras.Scene2D.Camera | Yes | null | The camera to use for this context. |
| clearColor | Array.<number> | Yes | "[0, 0, 0, 0]" | The color to clear the framebuffer with. This is an array of 4 values: red, green, blue, alpha. |
| useCanvas | boolean | Yes | false | Whether to use the canvas as the framebuffer. |
| copyFrom | Phaser.Renderer.WebGL.DrawingContext | Yes | The DrawingContext to copy from. | |
| width | number | Yes | The width of the framebuffer, used if copyFrom and useCanvas are not set. Default is the renderer width. | |
| height | number | Yes | The height of the framebuffer, used if copyFrom and useCanvas are not set. Default is the renderer height. | |
| pool | Phaser.Renderer.WebGL.DrawingContextPool | Yes | The pool to return to when this context is no longer needed. Used only for temporary contexts. |
Type: object
Member of: Phaser.Types.Renderer.WebGL.RenderNodes
Source: src/renderer/webgl/typedefs/DrawingContextOptions.js#L7
Since: 4.0.0