swrast: drawing a line 2.0px in width has incorrect offset
Submitted by Campbell Barton
Assigned to mes..@..op.org
Description
Hi, when using blender3d with Mesa's libGL.so I notice a display problem that isnt present with NVidia's or ATI's drivers.
http://members.optusnet.com.au/cjbarton/mesabug.png
This looks to be a bug in Mesa's line drawing function since blender uses it to draw the outline.
Note that mesa has done this for a long time, and older versions had this problem also.
The example below uses glLineWidth(2.0) and glDepthMask(0) and I assume line drawing with glLineWidth(2.0) to be the problem.
is the function in blender that draws the outline around the mesh - drawobject.c:1938
/* Mesh drawing routines */
static void draw_mesh_object_outline(Object *ob, DerivedMesh *dm) {
if(G.vd->transp==0) { // not when we draw the transparent pass
glLineWidth(2.0);
glDepthMask(0);
/* if transparent, we cannot draw the edges for solid select... edges have no material info.
drawFacesSolid() doesn't draw the transparent faces */
if(ob->dtx & OB_DRAWTRANSP) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
dm->drawFacesSolid(dm, set_gl_material);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
else {
dm->drawEdges(dm, 0);
}
glLineWidth(1.0);
glDepthMask(1);
}
}