Created
June 15, 2019 08:22
-
-
Save doorbash/29c11812c0b24d23b77f1d1e246a176c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 mediump vec2 var_texcoord0; | |
uniform lowp sampler2D texture_sampler; | |
void main() { | |
float x = var_texcoord0.x - 0.5; | |
float y = var_texcoord0.y - 0.5; | |
int angle = 20; | |
float rad = radians(90 - angle); | |
if(angle == 0) { | |
} else if(angle > 0 && y > 0 && x > 0) { | |
if(angle >= 90 || tan(rad) < (y / x)) { | |
gl_FragColor = texture2D(texture_sampler, var_texcoord0.xy); | |
} | |
} else if(angle > 90 && x > 0 && y < 0) { | |
if(angle >= 180 || tan(rad) < (y / x)) { | |
gl_FragColor = texture2D(texture_sampler, var_texcoord0.xy); | |
} | |
} else if(angle > 180 && x < 0 && y < 0) { | |
if(angle >= 270 || tan(rad) < (y / x)) { | |
gl_FragColor = texture2D(texture_sampler, var_texcoord0.xy); | |
} | |
} else if(angle > 270 && x < 0 && y > 0) { | |
if(angle == 360 || tan(rad) < (y / x)) { | |
gl_FragColor = texture2D(texture_sampler, var_texcoord0.xy); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment