Original Post
I'm working on a shader graphics engine. First, it disables the color channels and renders the scene to the z-buffer. Then, it turns the color writing back on, and renders the final scene. This works great in that it only has to pixel shade the pixels that are not rejected by the final z-buffer. I get a little z fighting because the pixel shaders are not outputting the same z-value as the fixed pipeline. Has anybody else had this happen? This happens to all my geometry in the scene, even the quads that are rendered using the world matrix set as the identity matrix. It can easily be fixed by adding a small offset to the z value in the vertex shader, but that solution doesn't seem ideal. I've heard messing with the z-bias render state is not a good solution either. Anything I'm missing? Thanks for the help.