饱和度算法

uniform sampler2D inputTexture;
varying vec2 coordinate;
uniform flost saturation;

const mediump vec3 luminanceWeight = vec3(0.2124, 0.7154, 0.0721);
void mian(){
      vec4 textureColor = texture2d(inputTexture, coordinate);
      float luminance = dot(textureColor.rgb, luminanceWeight);
      vec3 grayScaleColor = vec3(luminance);
      gl_fragColor = vec4(mix(grayScaleColor, textureColor.rgb, saturation), textureColor.w);
}

你可能感兴趣的:(饱和度算法)