Squishy scroll

Simple shader that makes your TextureRect moving with squish effect inside.

You have to select Tile in Stretch Mode:

Shader code
shader_type canvas_item;

uniform float scroll_speed = 0.08;
//uniform vec2 texture_scroll = vec2(1.0, 0.0);

void fragment()
{
    vec2 uv = UV;
    uv.x = UV.x * 1.0 + pow(abs(sin(3.14 * UV.x/2.0)),2.0);
    
    //COLOR = texture(TEXTURE, uv + texture_scroll);
    COLOR = texture(TEXTURE, uv + (scroll_speed * TIME));
}
Tags
scroll, scrolling, squish, squishy
The shader code and all code snippets in this post are under MIT license and can be used freely. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

Earthbound-like battle background shader w/scroll effect and palette cycling

Simple tiled texture scroll

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments