   How can I do this? (pixel shaders and z/alpha/stencil testing possible involved)
  Is there any way to accomplish the following with pixel shaders, z/alpha/stencil testing, other ways?For each pixel:1. Z-Test the z value from vertex shader against what's in the Zbuffer2. Have the pixel shader write a new z value to the z bufferRepeat 1-2 a bunch of times with different primitives.If I enable Z-Testing and write to oDepth in the pixel shader, what it ends up doing is:1. Have the pixel shader compute a z value2. Z-Test the z value from pixel shader against what's in the Zbufferwhich is not what I want.I'm using Direct3D if it matters.   