Essay on Vertical Tearing and Jerking

Miscellaneous Forums/General Discussion/Essay on Vertical Tearing and Jerking

Grey .... you can do glFlush() at certain points in the code, maybe halfway through a frame, would help. This will force the gfx card to draw what it has in its buffer.

However, to your second assumption, it would not help *directly* with tearing because when you flush the card all you're doing is asking it to draw stuff to the backbuffer. It's not the drawing to the backbuffer that makes things tear, it's the copy to the front buffer. However, that said, if the gfx card has to a) draw everything all at once and b) then copy to the front buffer, chances are that it would finish drawing to the front buffer *sooner* if it had already finished drawing to the backbuffer earlier in the code.

ie, if the gfx card finishes all drawing to the backbuffer way before the flip time come, then when the flip happens it doesnt have anything holding it back so it will copy to the front right away. This *might* allow it to be far enough ahead of the vwait that it doesn't produce tearing.

It also *might* be worthwhile doing a glFlush() (in opengl at least) just before you do a Flip, since the flip will spend some time waiting, so you might as well use that time to have the gfx card begin drawing its stuff if it hasn't already. And remember though in some cases the gfx card will render immediately and you wont have any benefit by trying to force a flush. Also they say that flushing should be used sparingly, I forget the reason, but something to do with that it doesn't return control to your app until the flush is complete or something? Who knows, maybe it'll help.

Do you know that all the tearing problems are DX only and would be fixed by updating DX, or does it apply to OpenGL as well?

Also, do the people who get tearing in window mode, also get tearing by using a MaxGUI window?

I also agree that primarily you want to open a screen display which is correct on a majority of systems, but then offer extra options for those who are inclined to seek and use them. Ideally your basic mode will be free of tearing and will open properly.

The vertical flipping (in strips) rather than horizontal full-screen copy may or may not help, I might test it eventually. Generally speaking on my system, Flip 1 is smooth and solid with no tearing, so I wouldn't know.