2014-05-10 10:13:12 +08:00
|
|
|
/*
|
|
|
|
* LICENSE ???
|
|
|
|
*/
|
2014-05-10 07:45:42 +08:00
|
|
|
const char* ccLabelOutline_frag = STRINGIFY(
|
2014-05-10 10:13:12 +08:00
|
|
|
\n#ifdef GL_ES\n
|
2014-05-10 07:45:42 +08:00
|
|
|
precision lowp float;
|
2014-05-10 10:13:12 +08:00
|
|
|
\n#endif\n
|
2014-05-10 07:45:42 +08:00
|
|
|
|
|
|
|
varying vec4 v_fragmentColor;
|
2014-05-16 08:22:53 +08:00
|
|
|
varying vec2 v_texCoord;
|
|
|
|
|
|
|
|
uniform vec4 u_effectColor;
|
|
|
|
uniform vec4 u_textColor;
|
2014-05-10 07:45:42 +08:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 sample = texture2D(CC_Texture0, v_texCoord);
|
|
|
|
float fontAlpha = sample.a;
|
|
|
|
float outlineAlpha = sample.r;
|
2015-06-08 17:56:43 +08:00
|
|
|
if ((fontAlpha + outlineAlpha) > 0.0){
|
2014-05-16 08:22:53 +08:00
|
|
|
vec4 color = u_textColor * fontAlpha + u_effectColor * (1.0 - fontAlpha);
|
2014-05-10 07:45:42 +08:00
|
|
|
gl_FragColor = v_fragmentColor * vec4( color.rgb,max(fontAlpha,outlineAlpha)*color.a);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
discard;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|