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); } }
glLineWidth(2.0); I have the impression that NVIDIA drivers do not draw a 2 pixel wide line in this case... But Mesa does it. However, Mesa's output is not really good looking in this case.
The image shows a 1px line around a 3d object, but this only works because the line drawn is 2px wide, and half of it is masked out by the 3d cube. Also, this works for ATI cards as well, which makes me think its not an nvidia quirk. A default install of blenders will show this problem if you want to test. Is there any other way to validate the OpenGL drawing? Here are some screenshots of opengl outlines rendering correctly. http://www.zeronave.it/zn/wp-content/uploads/2007/04/blender1.png http://www.lordfreedom.com/Pagine/Grafica/Download/Immagini/Blender.jpg http://upload.wikimedia.org/wikibooks/en/0/03/Screenshot-5.png http://www.siteduzero.com/uploads/fr/files/8001_9000/8249.png - with mesa only the top and right lines show. http://www.webalice.it/fulvio.peruggi/public/Pegasos&MorphOS/Articles/06_MorphOS_TLOS/Blender.jpg
Note, the bug is not that the line drawn by mesa is not 2.0px, I expect both NVidia drivers and Mesa do this, the bug is that Mesa draws the Offset of that line differently. you can see that the line is offset to the top right of the model. Open blender with teh default scen and middle ckick drag in the 3d view to reproduce this.
I think the root problem is Mesa uses a different rasterization method for lines and polygon edges that hits different pixels. So, things don't match up exactly. Note that Mesa's lines and polygon egdes are conformant so nothing's really incorrect. With some work, Mesa's lines could be drawn differently. One experiment to try would be to enable GL_LINE_SMOOTH and see what happens since AA lines are drawn in a manner very similar to polygon edges.
enabled GL_LINE_SMOOTH and GL_BLEND and in this case Mesa gives very similar results to NVidea http://members.optusnet.com.au/cjbarton/mesa_bug.png
Is it hard to change this? - It seems that offsetting the line would not be a big change.
This is specific to swrast and the issue is still present. Hardware drivers render the lines correctly.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/289.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.