If you want to draw antialiased, enable multisampling or use a multisampling-FBO. If you don’t want to spend so much resources on a few edges, extract the relevant code from here:

```
#define ANTIALIAS_EDGE
//#include "Tex1.c"
#include "system.h"
/*
lightmapped textured. Write albedo to COLOR0 and lightness to COLOR1
*/
attribute1(vec3 inNormal);
attribute2(vec4 inCoord); // contains both vu0 and uv1
varying0(vec3 varNormal);
varying1(vec4 varCoord);
varying2(vec3 varPos);
varying3(vec4 varPosix);
texture0(sampler2D tex0);
texture1(sampler2D tex1);
texture7(sampler2D texNoise1);
#if IS_VERTEX
uniform mat4 mvpx : C0;
void main(){
varNormal= inNormal;
varCoord = inCoord;
varPos = glVertex.xyz;
vec4 thePos = mvpx * glVertex;
gl_Position = thePos;
#ifdef ANTIALIAS_EDGE
gl_Position.z-=0.0001;
varPosix = thePos;
#endif
}
#endif
#if IS_FRAGMENT
void main(){
vec4 ALBEDO = texture2D(tex0,varCoord.xy);
vec4 LIGHTM = texture2D(tex1,varCoord.zw);
vec4 noise1 = texture2D(texNoise1,varCoord.zw*32);
float noise2 = (noise1.x*noise1.y*noise1.z+0.5);
noise2=noise2*0.3+0.7;
vec3 varPos2 = varPos - vec3(0,1,0);
float dist1 = 4.0/dot(varPos2,varPos2);
LIGHTM+=dist1*dist1*0.9;
gl_FragColor = ALBEDO*LIGHTM*noise2 + LIGHTM*0.3;
//gl_FragColor = ALBEDO*LIGHTM*noise2+LIGHTM*0.3;
#ifdef ANTIALIAS_EDGE
vec2 ScreenSizeHalf = vec2(1024/2,576/2); // for 640x480 screen
vec2 posix1= (varPosix.xy/varPosix.w+1)*ScreenSizeHalf;
vec2 fpos = gl_FragCoord.xy;
float dist = distance(fpos,posix1);
gl_FragColor.w = saturate(1-dist);
//gl_FragColor.xyz=vec3(1,0,0);
//gl_FragColor.w = 0.2/(dist*dist);
#endif
}
#endif
```

Enable alpha-blending mode, set line-width = 2 . Draw the lines as you usually would, but with the above shader.

With the above shader you can also antialias a quad’s edges in a second pass: draw the geometry in wireframe mode: glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);

The line-antialiasing has a lot of requirements to be enabled, and sometimes is locked only to be used with Quadro/FireGL, afaik. It had always been of worse quality than the proposed shader or CSAA anyway.