Skip to content

Instantly share code, notes, and snippets.

@jimmyjonezz
Created March 19, 2020 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmyjonezz/b339415c8f674955c7e1a35208f1d4ae to your computer and use it in GitHub Desktop.
Save jimmyjonezz/b339415c8f674955c7e1a35208f1d4ae to your computer and use it in GitHub Desktop.
squash shader
shader_type canvas_item;
render_mode blend_mix;
uniform float squash_power = 0.0;
uniform float squash_position = 0.0;
void fragment() {
vec2 uv = SCREEN_UV;
float PI = 3.14159;
float squash = cos((uv.y + (squash_position)) * PI * 2.0 + PI * 0.5) * squash_power;
uv.x = uv.x * (1.0 - squash) + .5 * squash;
COLOR = texture(SCREEN_TEXTURE, uv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment