From e38864abb117aeaa90d06b44458022e9600bfeed Mon Sep 17 00:00:00 2001 From: z2045217 <386957065@qq.com> Date: Wed, 14 Dec 2016 14:29:18 +0800 Subject: [PATCH] Improve beauty filter shader (#267) --- library/src/main/res/raw/beauty.glsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/src/main/res/raw/beauty.glsl b/library/src/main/res/raw/beauty.glsl index 50b5186..1a32a63 100644 --- a/library/src/main/res/raw/beauty.glsl +++ b/library/src/main/res/raw/beauty.glsl @@ -7,7 +7,7 @@ uniform vec2 singleStepOffset; varying vec2 textureCoordinate; -const vec4 params = vec4(0.33, 0.63, 0.4, 0.35); +const vec4 params = vec4(0.748, 0.874, 0.241, 0.241); const vec3 W = vec3(0.299,0.587,0.114); const mat3 saturateMatrix = mat3( 1.1102,-0.0598,-0.061, @@ -106,4 +106,6 @@ void main() { vec3 satColor = gl_FragColor.rgb * saturateMatrix; gl_FragColor.rgb = mix(gl_FragColor.rgb, satColor, params.a); + + gl_FragColor.rgb = vec3(gl_FragColor.rgb + vec3(-0.096)); } \ No newline at end of file