PDA

View Full Version : Flickering glDrawPixels



06-22-2004, 05:42 AM
Hi, anybody knows why glDrawPixels(0,y) flickers?
coords for glRasterPos are from gluUnProject

mikael_aronsson
06-22-2004, 05:58 AM
Hi !

Depends on what you mean with "flickering", the most common problem is that you are not using double buffering, glDrawPixels is a pretty slow operation and can cause flickering if you are not using doublebuffering.

Mikael

06-24-2004, 12:56 AM
To be more precise:
- i use double bufferin',
- i use gluUnProject to get coords for glRasterPos,
- every time i want to render on the left edge (x=0, y=no matter what) and then i rotate camera (gluLookAt) the bitmap drawed by glDrawPixels flicks - it's sometimes visible, sometimes not
- i got rid of the problem of performance with glDrawPixels - now it's amazingly fast! - i can draw many time ~1024 bitmaps without performance degradation :)

Relic
06-24-2004, 02:26 AM
- every time i want to render on the left edge (x=0, y=no matter what) and then i rotate camera (gluLookAt) the bitmap drawed by glDrawPixels flicks - it's sometimes visible, sometimes not That happens if the rasterpos gets invalid, which is when it's not in the 3D viewing frustum after transformations.
A simple fix would be to enable this
http://oss.sgi.com/projects/ogl-sample/registry/IBM/rasterpos_clip.txt
if it's supported by your implementation.

Otherwise you need to make sure your transformed rasterpos does not fall oout of the frustum, or if it does, clamp it to the screen and skip pixels of the source bitmap.

ZbuffeR
06-24-2004, 11:16 AM
... or just read the GL FAQ :
http://www.opengl.org/resources/faq/technical/clipping.htm#0070