Skip to main content
Version: Phaser v4.0.0-rc.6

Types.Renderer.WebGL.RenderNodes

SubmitterSpriteGPULayerConfig

<static> SubmitterSpriteGPULayerConfig

nametypeoptionaldefaultdescription
namestringYes"'SubmitterSpriteGPULayer'"The name of the RenderNode. This should be unique within the manager.
vertexSourcestringYesThe vertex shader source code. If not provided, a default quad shader will be used.
fragmentSourcestringYesThe 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

nametypeoptionaldefaultdescription
namestringNoThe name of the RenderNode. This should be unique within the manager.
instancesPerBatchnumberYesThe 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.
verticesPerInstancenumberYes4The number of unique vertices per instance. This is usually 4 for a quad.
indicesPerInstancenumberYes6The 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.
maxTexturesPerBatchnumberYesThe 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.
indexBufferDynamicbooleanYesfalseWhether the index buffer should be created as a dynamic buffer. This is useful for handlers that need to change the index data frequently.
shaderNamestringYesThe base name to use for the shader program.
vertexSourcestringYesThe vertex shader source code. If not provided, a default quad shader will be used.
fragmentSourcestringYesThe fragment shader source code. If not provided, a default quad shader will be used.
shaderAdditionsArray.<Phaser.Types.Renderer.WebGL.ShaderAdditionConfig>YesAn array of shader additions to apply to the shader program.
shaderFeaturesArray.<string>YesAn array of shader features to enable in the shader program.
vertexBufferLayoutPhaser.Types.Renderer.WebGL.WebGLAttributeBufferLayout | anyYesThe 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.
vertexBufferLayoutRemoveArray.<string>YesAn 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.
vertexBufferLayoutAddArray.<(Phaser.Types.Renderer.WebGL.WebGLAttributeLayout | any)>YesAn 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.

nametypeoptionaldescription
enabledbooleanNoWhether to use self-shadowing.
penumbranumberNoSelf-shadowing penumbra strength.
diffuseFlatThresholdnumberNoSelf-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.

nametypeoptionaldescription
normalGLTexturePhaser.Renderer.WebGL.Wrappers.WebGLTextureWrapperNoThe normal map texture to render.
normalMapRotationnumberNoThe rotation of the normal map texture.
selfShadowPhaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerQuadRenderOptionsSelfShadowYesSelf-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.

nametypeoptionaldescription
multiTexturingbooleanYesWhether to use multi-texturing.
lightingPhaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerQuadRenderOptionsLightingYesHow to treat lighting. If this object is defined, lighting will be activated, and multi-texturing disabled.
smoothPixelArtbooleanYesWhether 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

nametypeoptionaldefaultdescription
namestringNoThe name of the RenderNode. This should be unique within the manager.
batchHandlerstring | Phaser.Renderer.WebGL.RenderNodes.BatchHandlerYes"'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

nametypeoptionaldefaultdescription
namestringYes"'SubmitterQuad'"The name of this RenderNode.
rolestringYes"'Submitter'"The expected role of this RenderNode.
batchHandlerstringYes"'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.

nametypeoptionaldefaultdescription
autoClearboolean | Array.<boolean>YestrueWhether 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.
blendModenumberYes0The blend mode to use when rendering.
cameraPhaser.Cameras.Scene2D.CameraYesnullThe camera to use for this context.
clearColorArray.<number>Yes"[0, 0, 0, 0]"The color to clear the framebuffer with. This is an array of 4 values: red, green, blue, alpha.
useCanvasbooleanYesfalseWhether to use the canvas as the framebuffer.
copyFromPhaser.Renderer.WebGL.DrawingContextYesThe DrawingContext to copy from.
widthnumberYesThe width of the framebuffer, used if copyFrom and useCanvas are not set. Default is the renderer width.
heightnumberYesThe height of the framebuffer, used if copyFrom and useCanvas are not set. Default is the renderer height.
poolPhaser.Renderer.WebGL.DrawingContextPoolYesThe 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