Created
June 17, 2013 08:20
-
-
Save kazukitanaka0611/5795406 to your computer and use it in GitHub Desktop.
point 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 = textureCoordinate.xy; | |
highp float color = 0.0; | |
highp float mBlobX = 0.5 + sin(0.01) * 0.5; | |
color += (1.0 / distance(position,vec2(mBlobX, 0.5))) * 0.05; | |
gl_FragColor = vec4(vec3(color*0.5,color*1.0,color*1.0), 1.0); | |
} | |
); | |
return kFragmentShaderString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment