From 65fcb8fba9b75ebf5d4b8296b03a219a7c5a5c61 Mon Sep 17 00:00:00 2001 From: xufuji456 Date: Thu, 20 Oct 2022 11:13:23 +0800 Subject: [PATCH] Feature: mirror shader --- .../src/main/res/raw/default_fragment.glsl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CameraFilter/src/main/res/raw/default_fragment.glsl b/CameraFilter/src/main/res/raw/default_fragment.glsl index 7dbf126..e280bd8 100644 --- a/CameraFilter/src/main/res/raw/default_fragment.glsl +++ b/CameraFilter/src/main/res/raw/default_fragment.glsl @@ -24,8 +24,20 @@ void main(){ // xy.y = xy.y * 2.0; // } else { // xy.y = (xy.y - 0.5) * 2.0; +// } + // white black +// const vec3 weight = vec3(0.3, 0.59, 0.11); +// float gray = dot(textureColor.rgb, weight); + // invert +// 1.0 - textureColor.rgb + // mirror +// if (xy.x <= 0.5) { +// xy.x += 0.25; +// } else { +// xy.x -= 0.25; +// xy.x = 1.0 - xy.x; // } - vec3 centralColor = texture2D(inputImageTexture, xy).rgb; - gl_FragColor = vec4(centralColor.rgb,1.0); + vec3 textureColor = texture2D(inputImageTexture, xy).rgb; + gl_FragColor = vec4(textureColor.rgb,1.0); } \ No newline at end of file