The name of the filter.
The manager that owns this filter.
OptionalfragmentShaderKey: stringThe key of the fragment shader source in the shader cache. This will only be used if fragmentShaderSource is not set.
OptionalfragmentShaderSource: stringThe fragment shader source.
OptionalshaderAdditions: ShaderAdditionConfig[]An array of shader additions to apply to the shader program.
The index buffer defining vertex order.
The manager that owns this RenderNode.
The name of the RenderNode.
The program manager used to create and manage shader programs. This contains shader variants.
ReadonlyvertexThe vertex buffer layout for this RenderNode.
This consists of 4 bytes, 0-3, forming corners of a quad instance.
By default this is an empty method hook that you can override and use in your own custom render nodes.
This method is called at the start of the run method.
Don't forget to call it in your custom method.
The context currently in use.
By default this is an empty method hook that you can override and use in your own custom render nodes.
This method is called at the end of the run method.
Don't forget to call it in your custom method.
The context currently in use.
Run the filter. It returns a drawing context containing the output texture.
The filter controller.
The drawing context containing the input texture. This is either the initial render, or the output of the previous filter. This will be released during the run process, and can no longer be used.
OptionaloutputDrawingContext: DrawingContextThe drawing context where the output texture will be drawn. If not specified, a new drawing context will be generated. Generally, this parameter is used for the last filter in a chain, so the output texture is drawn to the main framebuffer.
Optionalpadding: Geom.RectangleThe padding to add to the input texture to create the output texture. If not specified, the controller is used to get the padding. This should be undefined for internal filters, so the controller will expand textures as needed; and defined as the negative padding of the previous filter for external filters, so the texture will shrink to the correct size.
Set whether the node should report debug information.
It wraps the run method with additional debug information.
Whether to report debug information.
Run any necessary modifications on the textures array. Override this method to handle texture inputs.
The filter controller.
The array of textures to modify in-place.
The drawing context in use.
Set up the uniforms for this shader, based on the controller.
The filter controller.
The drawing context in use.
Set up the shader configuration for this shader. Override this method to handle shader configuration.
The filter controller.
The drawing context in use.
This is a base class for all filters that use a shader. Most filters will extend this class.
It takes care of setting up the shader program and vertex buffer layout. It also provides the
runmethod which handles the rendering of the filter. When rendering, it generates a new DrawingContext to render to, and releases the input DrawingContext.Note: be careful when using
gl_FragCoordin shader code. This built-in variable gives you the "window relative" coordinate of the pixel being processed. But this is actually relative to the framebuffer size, and Phaser treats all framebuffers except the main canvas as being vertically flipped. This means thatgl_FragCoord.y = 0in a shader will be the bottom of a framebuffer, but the top of the canvas. This meansgl_FragCoordgives different results when it's inside a framebuffer (like a Render Texture or Filter) compared to the main canvas. Be aware of this restriction when writing shaders.