mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12247 from stari4ek/v3-outline-inner-holes
improve rendering of letter's inner shapes when outline is used
This commit is contained in:
commit
a202387800
|
@ -17,7 +17,7 @@ void main()
|
||||||
vec4 sample = texture2D(CC_Texture0, v_texCoord);
|
vec4 sample = texture2D(CC_Texture0, v_texCoord);
|
||||||
float fontAlpha = sample.a;
|
float fontAlpha = sample.a;
|
||||||
float outlineAlpha = sample.r;
|
float outlineAlpha = sample.r;
|
||||||
if (outlineAlpha > 0.0){
|
if ((fontAlpha + outlineAlpha) > 0.0){
|
||||||
vec4 color = u_textColor * fontAlpha + u_effectColor * (1.0 - fontAlpha);
|
vec4 color = u_textColor * fontAlpha + u_effectColor * (1.0 - fontAlpha);
|
||||||
gl_FragColor = v_fragmentColor * vec4( color.rgb,max(fontAlpha,outlineAlpha)*color.a);
|
gl_FragColor = v_fragmentColor * vec4( color.rgb,max(fontAlpha,outlineAlpha)*color.a);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue