Skip to content

Instantly share code, notes, and snippets.

@ericleong
Created February 26, 2015 05:02
Show Gist options
  • Save ericleong/c786c031b1767aab6f2f to your computer and use it in GitHub Desktop.
Save ericleong/c786c031b1767aab6f2f to your computer and use it in GitHub Desktop.
Fade Effect Fragment Shader
#extension GL_OES_EGL_image_external : require
precision mediump float;
varying vec2 vTextureCoord;
uniform samplerExternalOES sTexture;
void main() {
vec4 color = texture2D(sTexture, vTextureCoord);
float r = 0.2 + 0.8 * color.r;
float g = 0.2 + 0.8 * color.g;
float b = 0.2 + 0.8 * color.b;
gl_FragColor = vec4(r, g, b, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment