Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: GL_LINE_STIPPLE causes inaccuracy

  1. #1
    Member Regular Contributor
    Join Date
    Sep 2002
    Posts
    384

    GL_LINE_STIPPLE causes inaccuracy

    When I use GL_LINE_STIPPLE, the line is horizontally offset by one pixel. I am using a GEForce 4 MX, a pretty common card.

    Without stipple:


    With stipple:

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: GL_LINE_STIPPLE causes inaccuracy

    did u try first offsetting the view by by 0.375 0.375
    else u could ditch stipple and draw the line with a stippiled texture, or if u use glsl etc u wouldnt need a texture

  3. #3
    Member Regular Contributor
    Join Date
    Sep 2002
    Posts
    384

    Re: GL_LINE_STIPPLE causes inaccuracy

    Why would I want to offset the view by 0.375?

    Okay, I see why you asked that, but why would stippled lines be behaving differently from non-stippled lines? If they just both worked the same, it would be fine.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,537

    Re: GL_LINE_STIPPLE causes inaccuracy

    Maybe I'm weird but they look fine to me.

    -SirKnight
    -SirKnight

  5. #5
    Member Regular Contributor
    Join Date
    Sep 2002
    Posts
    384

    Re: GL_LINE_STIPPLE causes inaccuracy

    Look carefully. The stippled line does not line up to the grid.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Jun 2001
    Posts
    198

    Re: GL_LINE_STIPPLE causes inaccuracy

    Originally posted by halo:
    When I use GL_LINE_STIPPLE, the line is horizontally offset by one pixel. I am using a GEForce 4 MX, a pretty common card.
    Interesting. That card probably doesn't support stippling in hardware (or if it supports it, it's disabled by the driver and only enabled on the Quadro counterpart).

    That means that the stippled lines are transformed in software (at least you need to transform then in sw to apply the proper stipple pattern) and then rendered using transformed textured lines or fully rendered in software.

    Anyhow, my hunch is that the software transformation is giving slightly different results from the hardware transformation and causing that pixel mismatch.

    As some other people have said, you can try rendering textured lines, but note that it's very tricky to get proper (OpenGL conformant) stippling with textured lines.

    It's interesting (or rather unfortunate) that OpenGL doesn't require invariance wrt. stippling.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •