By default, when depth testing performed on a rendering surface, the Direct3D system updates the render target surface if the corresponding depth value (z or w) for each point is less than the value already in the depth buffer. You can change how the system performs comparisons on depth values by calling the IDirect3DDevice3::SetRenderState method with the dwRenderStateType parameter set to D3DRENDERSTATE_ZFUNC. The dwRenderState parameter should be set to one of the values in the D3DCMPFUNC enumeration.