1

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:

glMatrixMode(GL_MODELVIEW);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(color_p_v,GL_FLOAT,offset,color_array);
glDrawArrays(GL_POINTS,0,N);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);

I have omitted the array initialization here.

I have checked with gDEBugger that lines are rendered into back buffer after the glDrawArrays function 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?

genpfault
  • 51,148
  • 11
  • 85
  • 139
zulunation
  • 297
  • 1
  • 5
  • 13
  • 1
    do the lines remain after a clearbuffer and rerender? – ratchet freak Feb 12 '14 at 16:02
  • It's certainly not wrong to use `GL_POINTS`; with point sprites they are an effective way of doing various funny operations. – Bartek Banachewicz Feb 12 '14 at 16:02
  • Enable Double buffering. You could stop the render while is resizing. – adderly Feb 12 '14 at 17:08
  • You cannot draw the window while it is resizing anyway. Windows stops running the normal message pump while this is happening. One trick, however, is to run a timer at ***0 ms*** intervals when resizing begins and stop the timer when it finishes. Windows will continue to send timer events while resizing a window. – Andon M. Coleman Feb 12 '14 at 19:52
  • 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. – zulunation Feb 14 '14 at 16:59
  • I'm using PFD_DOUBLEBUFFER to enable double buffering. – zulunation Feb 14 '14 at 17:00
  • I'm rerendering window on resize but in that case why do lines remain when the window is not resized after resizing. Repaint doesn't help – zulunation Feb 14 '14 at 17:01

1 Answers1

0

It seems that i have found the problem. When specifying coordinates as in float like (5,6) for instance on ATI i get vertical lines. When specifying (5+0.5f,6+0.5f) everything is fine on all systems. This related how driver interprets the coordinates and pixel position. Integer coordinates values are lying between pixels not in the center of them.

I would like to read more about that issue but failed to find any good article on that.

zulunation
  • 297
  • 1
  • 5
  • 13
  • This is not up to the driver. It is exactly specified (unless you tell OpenGL to use a different convention). Read http://www.opengl.org/registry/specs/ARB/fragment_coord_conventions.txt – Damon Mar 09 '14 at 14:22