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 ww . j a v a2 s . c o m*/ public class GlSepiaShader extends GlShader { protected String mShaderName = "sepia"; @Override public String getName() { return mShaderName; } 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() {" + " vec4 FragColor = texture2D(sTexture, vTextureCoord);\n" + " gl_FragColor.r = dot(FragColor.rgb, vec3(.393, .769, .189));\n" + " gl_FragColor.g = dot(FragColor.rgb, vec3(.349, .686, .168));\n" + " gl_FragColor.b = dot(FragColor.rgb, vec3(.272, .534, .131));\n" + "}"; public GlSepiaShader() { super(DEFAULT_VERTEX_SHADER, FRAGMENT_SHADER); } }