z culling not working properly on some fragments

Started by
11 comments, last by Adaline 12 years, 5 months ago

A zNear value of 1.0 is the standard as far as I know, I would try that with a zFar of 1000.0 (if that doesn't cut into your scene). Also, what AutoDepthStencilFormat are you using with your presentation parameters when you create your device? I've had much better results with 24-bit depth buffers (D3DFMT_D24S8) than with what most tutorials set you up with - which is a 16-bit buffer most of the time. If you use 1.0/1000.0 and D3DFMT_D24S8 and you're still getting that problem it's not a z-fighting issue after all...


No, Near plane one unit away is not normal, its just what you do - personally I set near plane to 0.1 ?
In C++, friends have access to your privates.
In ObjAsm, your members are exposed!
Advertisement
The value for the near plane depends on your setup and the value itself can have impact on scale. a z-near of 1.0 can mean 'cull anything closer than a meter to the camera' which is clearly not right.
The last game I worked on had a z-near of 0.2 and a far of 333.3; there is no 'standard' value.
Yes I misworded that, the point is that temporary upping the zNear to 1.0 (which is certain to give a good 'scale') is the best way to go about debugging the OP's problem.
Thank you for your help !

I use a 32 bit depth buffer.
Now zNear=1.0 and zFar=1500. It looks like the bug less occurs

This topic is closed to new replies.

Advertisement