Direct3D9 application won't write to depth buffer

Posted by DeadMG on Game Development See other posts from Game Development or by DeadMG
Published on 2012-03-09T00:04:30Z Indexed on 2012/04/08 5:48 UTC
Read the original article Hit count: 399

Filed under:
|

I've got an application written in D3D9 which will not write any values to the depth buffer, resulting in incorrect values for the depth test. Things I've checked so far:

  • D3DRS_ZENABLE, set to TRUE
  • D3DRS_ZWRITEENABLE, set to TRUE
  • D3DRS_ZFUNC, set to D3DCMP_LESSEQUAL
  • The depth buffer is definitely bound to the pipeline at the relevant time
  • The depth buffer was correctly cleared before use.

I've used PIX to confirm that all of these things occurred as expected. For example, if I clear the depth buffer to 0 instead of 1, then correctly nothing is drawn, and PIX confirms that all the pixels failed the depth test. But I've also used PIX to confirm that my submitted geometry does not write to the depth buffer and so is not correctly rendered.

Any other suggestions?

© Game Development or respective owner

Related posts about directx9

Related posts about depth-buffer