Yoshi’s Island Shimmer – Heat Haze Distortion
This is a simple yet powerful post-processing shader adapted for Godot’s CanvasItem that applies a subtle, persistent distortion or wobble to the entire screen. This effect is ideal for simulating heat haze, liquid surfaces, magical aura, or the “shimmering” effect often used for visual feedback (like a character getting a power-up or, as noted, a “Yoshi dancing” effect).
The core effect is achieved by:
-
Noise Flow: The UV coordinates for the
noise_textureare animated over time, creating continuous, seamless motion. -
Distortion Map: The red (x) and green (y) channels of the sampled noise are used to create a 2D offset vector.
-
Screen Warp: This offset vector is scaled by the
strengthuniform and added to theSCREEN_UV, causing the final image to subtly warp and distort based on the flowing noise pattern.
Adjustable Uniforms (Shader Parameters):
Shader code
shader_type canvas_item;
uniform sampler2D noise_texture : source_color, repeat_enable;
uniform float strength : hint_range(0.0, 0.05, 0.001) = 0.005;
uniform vec2 speed = vec2(0.1, 0.05);
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
void fragment() {
vec2 noise_uv = UV + TIME * speed;
vec2 offset = (texture(noise_texture, noise_uv).xy * 2.0 - 1.0);
offset *= strength;
vec2 distorted_uv = SCREEN_UV + offset;
COLOR = texture(SCREEN_TEXTURE, distorted_uv);
}

