Yeah, thank you !
Shader is worked,but I meet another problem: every slot(attachment pic) drawn outline :doh:
,this is not what I want.,I just hope the whole body draw outline.
my shader code:
#ifdef GL_ES
precision lowp float;
#endif
varying vec4 v_fragmentColor;
varying vec2 v_texCoord;
uniform sampler2D CC_Texture0;
void main()
{
float radius = 0.005;
float threshold = 1.75;
vec4 accum = vec4(0.0);
vec4 normal = vec4(0.0);
normal = texture2D(CC_Texture0, v_texCoord);
accum += texture2D(CC_Texture0, vec2(v_texCoord.x - radius, v_texCoord.y - radius));
accum += texture2D(CC_Texture0, vec2(v_texCoord.x + radius, v_texCoord.y - radius));
accum += texture2D(CC_Texture0, vec2(v_texCoord.x + radius, v_texCoord.y + radius));
accum += texture2D(CC_Texture0, vec2(v_texCoord.x - radius, v_texCoord.y + radius));
accum *= threshold;
accum.r = 1.0;
accum.g = 0.0;
accum.b = 0.0;
// normal = (accum * (1.0 - normal.a)) + (normal * normal.a);
if (normal.a <= 0.05)
{
normal = (accum * normal.a) + (normal * normal.a);
}
else
{
normal = (accum * (1.0 - normal.a)) + (normal * normal.a);
}
gl_FragColor = v_fragmentColor*normal;
}