ccShader_UI_Gray.frag 350 B

1234567891011121314151617
  1. const char* ccPositionTexture_GrayScale_frag = R"(
  2. #ifdef GL_ES
  3. precision mediump float;
  4. #endif
  5. varying vec4 v_fragmentColor;
  6. varying vec2 v_texCoord;
  7. void main(void)
  8. {
  9. vec4 c = texture2D(CC_Texture0, v_texCoord);
  10. c = v_fragmentColor * c;
  11. gl_FragColor.xyz = vec3(0.2126*c.r + 0.7152*c.g + 0.0722*c.b);
  12. gl_FragColor.w = c.w;
  13. }
  14. )";