Skip to content

Instantly share code, notes, and snippets.

@omarojo
Created March 27, 2018 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omarojo/51ce5bb8f4b20f2ecc4f0d1d0b4dd0d2 to your computer and use it in GitHub Desktop.
Save omarojo/51ce5bb8f4b20f2ecc4f0d1d0b4dd0d2 to your computer and use it in GitHub Desktop.
Contrast Shader (GPUImage)
varying vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform float contrast;
void main()
{
vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);
gl_FragColor = vec4(((textureColor.rgb - vec3(0.5)) * contrast + vec3(0.5)), textureColor.w);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment