Skip to content

Instantly share code, notes, and snippets.

@akella
Created December 23, 2018 08:42
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 akella/20dd6a1318d26290a9cfc06f63f0ae5a to your computer and use it in GitHub Desktop.
Save akella/20dd6a1318d26290a9cfc06f63f0ae5a to your computer and use it in GitHub Desktop.
warp
vec2 warp(vec2 pos, vec2 amplitude)
{
pos = pos * 2.0-1.0;
pos.x *= 1.0 - (pos.y*pos.y)*amplitude.x * 0.2;
pos.y *= 1.0 + (pos.x*pos.x)*amplitude.y;
return pos*0.5 + 0.5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment