Skip to content

Instantly share code, notes, and snippets.

@lucasvanmol
Last active November 14, 2020 12:58
Show Gist options
  • Select an option

  • Save lucasvanmol/0c4a74cecb2b4cbcd2dd482347ebb871 to your computer and use it in GitHub Desktop.

Select an option

Save lucasvanmol/0c4a74cecb2b4cbcd2dd482347ebb871 to your computer and use it in GitHub Desktop.
shader_type canvas_item;
uniform float STRENGTH = 0.0;
uniform vec2 CENTER = vec2(0.5);
void fragment() {
vec2 uv = UV - CENTER;
float angle = STRENGTH * uv.y;
mat2 rot = mat2(
vec2( cos(angle), -sin(angle) ),
vec2( sin(angle), cos(angle) )
);
uv = rot * uv + CENTER;
COLOR = texture(TEXTURE, uv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment