[Bug 11956] New: drawing a line 2.0px in width has incorrect offset

View: New views
7 Messages — Rating Filter:   Alert me  

[Bug 11956] New: drawing a line 2.0px in width has incorrect offset

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=11956

           Summary: drawing a line 2.0px in width has incorrect offset
           Product: Mesa
           Version: unspecified
          Platform: x86 (IA32)
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa3d-dev@...
        ReportedBy: ideasman42@...


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);
        }
}


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[Bug 11956] drawing a line 2.0px in width has incorrect offset

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=11956





------- Comment #1 from khaqq@...  2007-08-12 07:52 PST -------

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.


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[Bug 11956] drawing a line 2.0px in width has incorrect offset

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=11956





------- Comment #2 from ideasman42@...  2007-08-12 19:49 PST -------
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


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[Bug 11956] drawing a line 2.0px in width has incorrect offset

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=11956





------- Comment #3 from ideasman42@...  2007-08-12 21:21 PST -------
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.


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[Bug 11956] drawing a line 2.0px in width has incorrect offset

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=11956





------- Comment #4 from brian.paul@...  2007-08-13 02:56 PST -------
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.


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[Bug 11956] drawing a line 2.0px in width has incorrect offset

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=11956





------- Comment #5 from ideasman42@...  2007-08-13 06:08 PST -------
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


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[Bug 11956] drawing a line 2.0px in width has incorrect offset

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=11956





--- Comment #6 from Campbell Barton <ideasman42@...>  2008-07-04 18:22:14 PST ---
Is it hard to change this? - It seems that offsetting the line would not be a
big change.


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
LightInTheBox - Buy quality products at wholesale price