Original Post
> I'm using following line to set my Projection Matrix and Clipping Plane. > D3DXMATRIX matProjection; > ZeroMemory(&matProjection, sizeof(matProjection)); > > // Use D3DX to create a left handed cartesian Field Of View transform > D3DXMatrixPerspectiveFovLH(&matProjection,D3DX_PI/DivFactor, > g_D3DSettings.m_fScreenAspect,1.0,ROWSPACING*ROWS); > > Where ROWSPACING=8000 > ROWS=256 > DivFactor=4 > g_D3DSettings.m_fScreenAspect=1024/768 > > > When i changed Near Clipping plane to 100.0f > this strange behaviour is gone. And a person replied identifying the problem elegantly and it's solution as follows. Yes, this is definitely the issue here, because the distribution of your z-buffer resolution is determined by the ratio of the near to far planes. The distribution of z-values is not linear, rather being concentrated towards the near clipping plane. With the settings shown, you have a near of 1.0 and a far of 1:2,048,000, which is extreme. The result is that, given each row is 8000 wide, at a distance of one row you've already used up 99.9875% of your z-buffer resolution! Even with a 32 bit z-buffer, your resolution would approach your row size towards the last row. By increasing your near plane to 100, now you have reduced this ration to 1:20,480, providing much better distribution of your z-buffer resolution.. ------------------- I can't figure out that how he determine how much of the depth buffer resolution is used? Q-1)Please let me know how he has determined this value 99.9875%. Q-2)In DXSDK docs,They've used the ratio of far-plane/near-plane and you're using far-plane/near-plane ratio. I hope that Some D3D Expert will put some lite over it and make all of us understand it more.Thanks.Take Care. Owais.