Created
December 23, 2018 08:42
-
-
Save akella/20dd6a1318d26290a9cfc06f63f0ae5a to your computer and use it in GitHub Desktop.
warp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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