Back to project page FxCameraApp.
The source code is released under:
MIT License
If you think the Android project FxCameraApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.af.experiments.FxCameraApp.shaders; /*from w w w .j a v a 2s. c o m*/ public class GlXRayShader extends GlShader { private static final String FRAGMENT_SHADER = "precision mediump float;" + "varying vec2 vTextureCoord;" + "uniform lowp sampler2D sTexture;" + "const highp vec3 weight = vec3(0.2125, 0.7154, 0.0721);" + "void main() {" + "lowp vec4 color = texture2D(sTexture, vTextureCoord);" + "color = vec4((1.0 - color.rgb), color.w);" + "float luminance = dot(color.rgb, weight);" + "gl_FragColor = vec4(vec3(luminance), 1.0);" + "}"; public GlXRayShader() { super(DEFAULT_VERTEX_SHADER, FRAGMENT_SHADER); } protected String mShaderName = "X Ray"; @Override public String getName() { return mShaderName; } }