grey_shader.fsh 333 B

1234567891011121314
  1. #ifdef GL_ES
  2. precision lowp float;
  3. #endif
  4. varying vec4 v_fragmentColor;
  5. varying vec2 v_texCoord;
  6. void main()
  7. {
  8. vec4 col = texture2D(CC_Texture0, v_texCoord);
  9. float grey = dot(col.rgb, vec3(0.299, 0.587, 0.114));
  10. float alpha = v_fragmentColor.a;
  11. gl_FragColor = vec4(grey * alpha, grey * alpha, grey * alpha, col.a * alpha);
  12. }