Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Game Objects
/
Shaders
Phaser 4.1.0
Phaser 4 examples
Shaders
15
examples
Examples
15
Basic Texture Shader
Demonstrates how to create a custom shader that accepts an image texture as a uniform and applies it using texture coordinates.
Change Shader Texture
Demonstrates how to dynamically swap textures used by a shader at runtime using the setTextures method.
Load Shader
Learn how to load an external GLSL fragment shader file and display it in your scene using a Shader Game Object.
Render Shader to Texture
Demonstrates how to render a fragment shader directly to a texture, which can then be used by standard Game Objects like Images and Sprites throughout your scene.
Setting Shader Uniforms
Demonstrates how to define custom uniform variables within a BaseShader and update their values at runtime using the setUniform method.
Shader Arcade Physics
This example demonstrates how to apply Arcade Physics to Shader Game Objects, including dynamic bodies with velocity and bounce, as well as static body collisions.
Shader as a Mask
Demonstrates how to use a custom GLSL shader as a dynamic mask for an image. It shows how to create a shader object and apply it to a Game Object through the filters system to create animated masking effects.
Shader Feedback Buffers
Demonstrates how to create a shader feedback loop by rendering multiple shaders to textures and using the output of one as the input for another.
Shader Render to Texture
Demonstrates how to render a GLSL shader to a texture and then use that texture across multiple Game Objects simultaneously.
Shader Render-to-Texture Feedback
Demonstrates how to create a feedback loop between multiple shaders by rendering each to a texture and passing those textures as sampler inputs to one another.
Shader Sandbox
Demonstrates layering multiple shaders with standard images and animating shader uniforms using the Tween Manager.
Shader Transforms
Learn how to manipulate a Shader Game Object using standard properties such as scale, rotation, and position, including how to apply tweens to them.
Shader Using an Updating Dynamic Texture
This example demonstrates how to use a Dynamic Texture as a sampler input for a fragment shader, allowing you to feed live-rendered graphics directly into a shader effect.
Shader with Dynamic Texture Input
This example demonstrates how to create a Dynamic Texture, draw images onto it, and then use that texture as a sampler input for a fragment shader.
Using a Shader as a Buffer
Demonstrates how to render a shader's output directly to a texture and use that texture as a sampler input for another shader.