   Streaming video behind geometry with OpenGL
  Hi all,  I am kind of stuck with this problem for sometime now. I have a video source from which I get an array of pixels which I need to display on the background. However, infront of this video I need to have geometry displayed. The Problem is I managed to get both the video and the model to be displayed -- the video with glDrawPixels and the model in the regular way. However I need the model to be always infront of the video and not be hidden by it. Currently, ( IMO the pixel is being display at Z value 0 ) when i rotate and move around the geometry it goes behind the array of pixels.. I display the array of pixels always before I redraw the geometry but still it happens. So I was wondering what would the way to avoid this.... Thanks  glClearColor(0.0, 0.0, 0.0, 0.0);  glPushMatrix();  gluOrtho2D(0, 256, 0, 256);  glLoadIdentity();  glEnable(GL_DEPTH_TEST);  glDepthFunc(GL_LEQUAL);  GLint viewport[4];    glGetIntegerv(GL_VIEWPORT, viewport);  makeCheckImage();  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);  glRasterPos3f(0.0, 0.0, 0.0);  glDrawPixels(256, 256, GL_RGB, GL_UNSIGNED_BYTE, &checkImage);  glPopMatrix();   
  Why don't you draw your object first (and modify the stencil buffer so that the stencil buffer has "1" where the object pixels are), then draw a textured quad for the video w/ stencil test (so it doesn't overlap the model) ?   ;  Thanks, your idea worked... Also did one more thing which worked and that was to disable the depth mask when drawing the pixels for the video. Thanks....   