PDA

View Full Version : what is the reason of texture mapping flickering



victorswan
07-26-2003, 08:49 AM
I build a wall with triangles then assign the brick texture on it, but when I move in the scene, the brick texture on the wall keep on flickering, I know this is a kind of alias, but how to deal with it?

AdrianD
07-26-2003, 09:21 AM
use mipmapping.
checkout anisotropic filtering.
read the opengl specs.

dorbie
07-26-2003, 04:25 PM
I woldn't advise anyone to read the OpenGL specs unless you are interested in something specific, it would certainly be tricky to discern the solution to a problem like this.

Get a good book, the "Red Book" is probably a good starting place. Don't read the specs unless you enjoy your eyes bleeding.

victorswan
07-26-2003, 04:38 PM
I already use mipmap, maybe I didn't discribe the error clearly, the flickering is when you moving the eye far away the wall, the brick texture on the wall keep on dithering, sometimes the wall under the brick texture can be seen, I try everything I can imagine, but can't find the reason

koljaw
07-27-2003, 08:58 PM
Sounds like a z buffer problem to me. Try changing the viewport z parameters and increase z buffer precision (if possible)

victorswan
07-27-2003, 09:43 PM
koljaw,
how to increase the Z buffer precision?

victorswan
07-27-2003, 11:03 PM
koljaw,you are right, I changed the z_near and z_far values to make their distance smaller, so it is almost fine. thank you very much.

TheAnt
07-31-2003, 04:38 AM
Just to be on the safe side, if you still notice some flickering, chek wether you have double buffering on, drawing to the back buffer, and swapping them after every frame.
2 (I didn't put 1 on the beginning http://www.opengl.org/discussion_boards/ubb/smile.gif ), how are you drawing your wall? if you are using double buffering, and the texture/color of the wall is showing, you might be drawing tho distinct poligons one on top of the other on the same x,y,z coordinates wich would create the problem due to the z-buffer precision (or unprecision). if you are simply texturing a shaded poly this should not happen, also it should not happen if you are using multitexturing and blending one texture over the other on the same poly.