It's called fighting
By: Akbar A.(syedali011@earthlink.net)
May 21, 2000
"the first rule of fightclub is, you do not talk about it. The second rule of fight club is,  YOU DO NOT TALK ABOUT!!!"

I have always wanted to say that in one of my articles. Well today i am going to be writing about what we call as "fighting" in computer graphics. It has a few other names but i think we *should* stick with this one ;)
This artifact called "fighting" occurs due to the nature of how the depth buffer algorithm sorts out the vertexes which are proccesed to draw.
Quite a few *commercial games* (homeworld), suffer from this problem. Don't ask me why, but today i would like to demonstrate what this artifact is and how to get ride of it. Well the best way i can show you what i mean when talking about this artifact is to show you a picture.


You know you have seen this before in a game! So don't act like this is new to you.

What you see above is a classic example of z-buffer fighting. This artifact occurs when two planes are aligned exactly into one surface. The z-buffer algorithm works by tagging each pixel as "infront" or "behind" certain objects in a it's view. When two planes are tagged as being equal to each other, this causes a serious flaw in the algorithm which is notable in the picture above.

To fix this problem you have 2 basic choices.
Your first choice, is to disable the depth buffer and not let the driver sort out the drawing. Usually, you would use this method when you have written an algorithm to project a shadow onto an aribtrary set of surfaces.
The second option is to design your levels and floor's (assuming that you are a game developer) so that they *always* use boxes as a foundation, instead of relying on a single plane.

peace,
akbar A.