Created
July 6, 2012 22:25
-
-
Save CastIrony/3063099 to your computer and use it in GitHub Desktop.
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
varying highp vec2 textureCoordinate; | |
uniform sampler2D inputImageTexture; | |
#define M_PI 3.1415926535897932384626433832795 | |
void main() | |
{ | |
highp vec2 centered = textureCoordinate - vec2(0.5, 0.5); | |
highp float angle = atan(centered.y, centered.x) / (M_PI * 2.0) + 0.5; | |
highp float mag = length(centered) * 2.0; | |
gl_FragColor = texture2D(inputImageTexture, vec2(angle, mag)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment