Depth Bias
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ3KvGiPKiaPvCi_VhZncWSDSJqN_TXiolgKiF4woilsfxD6Oo1qfnXVcr3iBnQZWKCL5LATYrTV0S6EP7NrFY2HMCgQVmFmy6ySyefK7iDRZKRqjRhIRaYMGx6GmTmekVKu0jA1M_yYHF/s320/dx9_depth_bias+2010-06-25+00-52-47-09.bmp)
To solve Z fighting issue: use depth bias. An application can help ensure that coplanar polygons are rendered properly by adding a bias to the z-values that the system uses when rendering the sets of coplanar polygons. To add a z-bias to a set of polygons, call the IDirect3DDevice9::SetRenderState method just before rendering them, setting the State parameter to D3DRS_DEPTHBIAS, and the Value parameter to a value between 0-16 inclusive. A higher z-bias value increases the likelihood that the polygons you render will be visible when displayed with other coplanar polygons. Offset = m * D3DRS_SLOPESCALEDEPTHBIAS + D3DRS_DEPTHBIAS where m is the maximum depth slope of the triangle being rendered. m = max(abs(delta z / delta x), abs(delta z / delta y)) reference: http://msdn.microsoft.com/en-us/library/bb205599%28VS.85%29.aspx Z Slope Scale = 0.0, Depth Bias = 0.0