Screen Warping

This shader creates a “screen warping” effect. It adds dynamic distortions to the image, creating a trembling or wave-like effect that can be used to enhance the atmosphere and retro gaming effect, or to simulate unstable or damaged screens.

Parameters:

  • warp_intensity: Controls the intensity of the distortion. The higher the value, the more noticeable the wave or trembling effect on the screen will be.
  • time_scale: Regulates the speed and dynamics of the distortions. Higher values will result in faster oscillations.
Shader code
shader_type canvas_item;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture;
uniform float warp_intensity : hint_range(0.0, 0.1) = 0.03; 
uniform float time_scale : hint_range(0.1, 10.0) = 1.0;

void fragment() {
    vec2 uv = SCREEN_UV;
    
    float warp = sin(uv.y * 10.0 + TIME * time_scale) * warp_intensity;
    
    uv.x += warp * smoothstep(0.2, 0.5, abs(uv.x - 0.5));
    
    COLOR = texture(SCREEN_TEXTURE, uv);
}
Tags
old style, ps1, psx, retro, Screen Warping
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from AivanWorld

OldSchoolDiffuseShader

Noise & Grain

CrossHairPoint (Round) : Godot 4.3

Related shaders

Screen Space Lens Flare – On Emissive Material

Erode screen effect

Dilate screen effect

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Mal
Mal
1 month ago

How can we apply it?