Skip to content

Instantly share code, notes, and snippets.

@kazukitanaka0611
Created June 17, 2013 08:20
Show Gist options
  • Save kazukitanaka0611/5795406 to your computer and use it in GitHub Desktop.
Save kazukitanaka0611/5795406 to your computer and use it in GitHub Desktop.
point light shader
- (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