Phaser 4 examples

Shader

  • 9 examples

Examples 9

Custom Shader Texture CoordinatesDemonstrates how to apply a custom shader to a specific frame from a texture atlas using setTextureCoordinatesFromFrame and building shaders using modular additions.Gradient Circle Wipe MaskDemonstrates creating a radial transition between two images by using a dynamic shader as a mask, with the circle's radius controlled by the distance of the pointer from the center.Gradient Linear Wipe MaskDemonstrates how to use a shader-generated linear gradient as a dynamic mask to create a smooth transition between two images controlled by the pointer.Gradient Ripple ReflectionDemonstrates how to use a procedurally generated gradient shader as a displacement map to create a dynamic water ripple effect on a reflected scene.Gradient ShineCreate an animated gradient shine effect by combining modular shader additions with normal map displacement and additive blending.Linear Gradient ShaderDemonstrates creating a linear gradient using the Shader Game Object by composing multiple GLSL fragments and configuring uniforms for positions, colors, and step counts.Perlin Noise Custom Shader DisplacementDemonstrates how to inject custom GLSL code into a shader using shader additions to generate Perlin noise. The resulting shader is rendered to a texture and applied as a real-time displacement filter to an image.Random Noise Shader AdditionsDemonstrates how to use the shaderAdditions property to inject custom GLSL code into the default fragment shader, creating dynamic noise effects with time-based uniforms.Shader Bilinear Gradient DisplacementCreate complex background effects by combining modular shader additions, render-to-texture, and displacement filters using bilinear and linear gradients.