This is a pixelshader that might help, if not used in realtime:
/*
// AGK Border sprite border shader
// use it on sprites (in order to render to image, realtime use in absolutly not advised)
in AGK the shader needs following code to work properly:
width# = 0.02
samples = 200
r# = 1.0 // rgb values normalized
g# = 1.0
b# = 1.0
SetShaderConstantByName(shad,"agk_bordercolor",r#,g#,b#,0)
SetShaderConstantByName(shad,"agk_data",width#,samples,0,0)
This will aswell allow you to modify parameters
*/
uniform vec4 agk_data;
uniform vec3 agk_bordercolor;
uniform sampler2D texture0;
varying mediump vec2 uvVarying;
varying mediump vec4 colorVarying;
void main()
{
vec4 VBuf = vec4(0); // create virtual buffer to write to
for(int i = 0; i < int(agk_data.y); i++) // do multisampler process for border
{
float r = radians( float( (i*2)*180/int(agk_data.y) ) );
vec2 offset = vec2( -cos(r) * 0.2, sin(r) ) * agk_data.x;
VBuf = VBuf + texture2D(texture0, uvVarying + offset);
VBuf.xyz = agk_bordercolor;
}
gl_FragColor = mix(VBuf, texture2D(texture0, uvVarying), texture2D(texture0, uvVarying).a); // mix stuff together
}