Why this tearing problem?
Hi, here is my first try at creating an object and a background but I am stuck with a display problem when the cube rotates: it flickers on and off.
Is this because my window is only single-buffered, it is supposed to be double-buffered but maybe I am doing somethinf wrong? This does not happen when there is no background to be hidden so I guess it has to do with z-buffering.
Click on the image to download the source.
Well, I solved the problem by simply turning off depth testing (glDisable(GL_DEPTH_TEST)). Now why would that be? I thought depth testing was supposed to be good...
Just make the background further
(you can find me on IRC : #opengl on undernet)
Just draw the background first and clear the depth buffer right after you draw it. Then it will be impossible for the background to hide anything. To make it easy for you, here is the command to do that:
/*
Draw Background
*/
glClear(GL_DEPTH_BUFFER_BIT);
/*
Draw Scene
*/
Have Fun!!!
/*
Draw Background
*/
glClear(GL_DEPTH_BUFFER_BIT);
/*
Draw Scene
*/
Have Fun!!!
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
I once had the same problem, turn depth testing back on, else their wont be any ! It is because when your plygon enter below the plane created by your textured quad for background it is behind another object so it is not drawn. Actually part of this object is so part of it is not drawn.
On another note, are you sure thats tearing ? 2 poeple on the glVelocity forums refereds to tearing as being a sort of flickery redrawing effect.
WHO DO THEY
THINK THEY''RE
FOOLING : YOU ?
GARAL website
On another note, are you sure thats tearing ? 2 poeple on the glVelocity forums refereds to tearing as being a sort of flickery redrawing effect.
WHO DO THEY
THINK THEY''RE
FOOLING : YOU ?
GARAL website
WHO DO THEYTHINK THEY'REFOOLING : YOU ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement