Skip to content

Commit

Permalink
Add Grayscale shader (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
tguerin authored Jul 1, 2020
1 parent 7383f85 commit 097165f
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.linkedin.android.litr.shader;

public class FragmentShaders {

public static final String GRAYSCALE_SHADER = "#extension GL_OES_EGL_image_external : require\n" +
"precision mediump float;\n" +
"varying vec2 vTextureCoord;\n" +
"uniform samplerExternalOES sTexture;\n" +
"const highp vec3 weight = vec3(0.2125, 0.7154, 0.0721);\n" +
"void main() {\n" +
" float luminance = dot(texture2D(sTexture, vTextureCoord).rgb, weight);\n" +
" gl_FragColor = vec4(vec3(luminance), 1.0);\n" +
"}\n";

private FragmentShaders() {
}
}

0 comments on commit 097165f

Please sign in to comment.