Created
June 17, 2013 08:09
-
-
Save kazukitanaka0611/5795364 to your computer and use it in GitHub Desktop.
Light shader
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
- (NSString *)getFragmentShaderString | |
{ | |
NSString *const kFragmentShaderString = SHADER_STRING | |
( | |
varying highp vec2 textureCoordinate; | |
uniform sampler2D inputImageTexture; | |
void main() | |
{ | |
highp vec2 position = -1.0 + 2.0 * textureCoordinate.xy; | |
highp float dist = length(position); | |
highp float x = sin(atan(position.y, position.x) * 15.0 + sin(0.01) * dist * 6.0); | |
highp vec3 brightColor = vec3(1.0, 1.0, 1.0); | |
gl_FragColor = vec4(brightColor * x, 1.0); | |
} | |
); | |
return kFragmentShaderString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment