Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glDrawArrays gives vertical lines when using GL_POINTS

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009

    glDrawArrays gives vertical lines when using GL_POINTS

    I'm drawing a points using glDrawArrays with GL_POINTS. On my Intel 82945G Express Chipset Family everything is working fine. But on ATI Radeon Mobility 5730 vertical lines appear randomly when resizing the window.
    Here is the code that renders the picture:
    glColorPointer(color_p_v,GL_FLOAT,offset,color_arr ay);
    I have omitted the array initialization here.
    I have checked with gDEBugger that lines are rendered into back buffer after the glDrawArraysfunction is executed.
    I saw similar questions here but people are having similar problems when rendering a texture. My case is a bit simpler.
    Also there are advice not to use GL_POINTS but this sounds strange to me.
    I want to understand what is going on under the hood.
    IMHO there is band implementation in particular driver but what is really going on?

    The lines appear at the certain width of the window. When they appear i'm covering the window with other windows(causing the WM_PAINT message and window rerender). The lines still there
    I'm using PFD_DOUBLEBUFFER to enable double buffering.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    I see you enabling the vertex array, but then not calling glVertexPointer(). Seems like a problem...

    Also, is "color_p_v" a number of components for the color vertex attribute, is "offset" really a "stride" not an offset (0 for "tightly packed"), and is "color_array" a CPU pointer to the start of the vertex color array?

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2009
    Dark Photon thanks for reply.
    It seems that i have solved the problem. The reason was that i was specifying the coordinates in a way: (x,y).
    When i have changed to (x+0.5,y+0.5) everything is fine.

    I have heard about that issue. The pixels are lying between integer values. And it seems that different drivers differently round the coordinates. But i'm not sure.
    Does anyone know the good article on that issue.

Posting Permissions

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