   avoiding depth clear...
  i saw this intresting peice of code to avoid depth clearing:Eliminate depth buffer clearing If the scene you''re drawing covers the entire window there is a trick which let''s you omit the depth buffer clear. The idea is to only use half the depth buffer range for each frame and alternate between using GL_LESS and GL_GREATER as the depth test function. Example:    int EvenFlag;   /* Call this once during initialization and whenever the window    * is resized.    */   void init_depth_buffer( void )   {   glClearDepth( 1.0 );   glClear( GL_DEPTH_BUFFER_BIT );   glDepthRange( 0.0, 0.5 );   glDepthFunc( GL_LESS );   EvenFlag = 1;   }   /* Your drawing function */   void display_func( void )   {   if (EvenFlag) {  glDepthFunc( GL_LESS );  glDepthRange( 0.0, 0.5 );   }   else {  glDepthFunc( GL_GREATER );  glDepthRange( 1.0, 0.5 );   }   EvenFlag = !EvenFlag;   /* draw your scene */   }found at: http://www.mesa3d.org/brianp/sig97/perfopt.htmi tried implementing this and glClear(0);this resulted in flickering, my sky box was rendered fine, but the rest of my scene flickered pretty badly, any ideas on if this really works or not? i did see a huge boost to FPS but this could be due to the flickering :? 
  My suggestion: just forget about it. This is a pretty old trick, often used in software renderers and on old video cards. It made a sense there, the clearing was a very costly operation on those supports.Today, things are very different. You should *always* clear the depth buffer (and stencil buffer) on a modern video card. The operation is extremely fast, and more important, it will allow the 3D chip to perform a number of optimizations on the scene rendered. For example early z-rejection or hierachical zbuffers ("Hyper-Z" ?) only work at maximum efficiency, if you clear the zbuffer every frame. In fact, you may even *lose* framerate, if you don''t clear the zbuffer on modern GPUs !;  indeed, forget about it (note the 97 in the url, thats how old that trick is), both ATI and nVidia recomend against using fancy tricks and just letting the card do the clearing ;  Though if you have S3 chip you could devide depth region in 10+ parts and every frame draw in one that''s closer than previous, and clear after 10+ frames.for ex if depth range = 0->1001st frm glVertex3f(x,y,90-100)2nd frm glVertex3f(x,y,80-90)3rd frm glVertex3f(x,y,70-80)...10th frm glVertex3f(x,y,0-10)glClrBuff(Gl_DTH)The subdivision should be affected only by precision (also dont forget that depth is not lineary mapped, so my ex is not really good)   ______________________________Madman ;quote:Original post by _Madman_  Though if you have S3 chip you could devide depth region in 10+ parts and every frame draw in one that''s closer than previous, and clear after 10+ frames.Say hello to most horrible z-fighting artifacts on anything else than simple 2D stuff, as the depth buffer range changes every frame... In other words: such zbuffer tricks are extremely evil, and belong into the deepest pits of hell. Never ever use them.;  Just let him try  ______________________________Madman ;  *shrugs*if he wants to waste his time then thats not our problem, we''d pointed out why its a bad and pointless idea and if anything will probably hurt the fps, not help it 