What's the relationship between zbuffers and perspective clipping planes? When I have a .x file with more than one subset I run into zbuffer problems if my near clip plane is 0.0:
D3DXMatrixPerspectiveFovLH(&g_matProj, D3DX_PI * 0.5f, 800.0f / 600.0f, 0.0f, 100.0f);
Screenshot of problem:
http://www.visualization.ca/~vdi/Train/train_incorrect.jpg
However, if I change the near clip plane to a value > 0.0, say 0.1, my mesh now renders correctly:
D3DXMatrixPerspectiveFovLH(&g_matProj, D3DX_PI * 0.5f, 800.0f / 600.0f, 0.1f, 100.0f);
Screenshot of correction:
http://www.visualization.ca/~vdi/Train/train_correct.jpg
Can anyone help me understand what exactly is going on?