Pixel over pixel....how?

Started by
1 comment, last by drChengele 14 years, 1 month ago
Hey. I'm trying to draw some pixels in the same location and position as some preexisting pixels. I want the new pixels to completely overwrite the old pixels. I've got alpha blending, alpha testing, and depthbufferwriteenable disabled, but the pixels are still "fighting" with each other depending on my camera location. How can I make the last drawn pixel overwrite the existing pixel completely? Thanks
Advertisement

Hi,

I assume that depth buffer comparison are also disabled?
There shouldn't be any fighting when depth buffer writes and comparisons are disabled.

Best regards
Quote:I've got alpha blending, alpha testing, and depthbufferwriteenable disabled

Just to make sure, check the result of your D3DDevice::Clear() method. Also as kauna said, if I were you I'd not only disable z-writing but z-testing too, at least when rendering the thing that needs to be "over". So in addition to D3DRS_ZWRITEENABLE, also switch off D3DRS_ZENABLE.

But if pixels are "fighting" that might indicate render states are ok, but something is wrong with z-values of polygons you are rendering. I had a similar problem which was caused by my near projection plane being set to 0.f. You can't do this, it messes up the projection matrix, so in this case set it to 1.f or at the very least 0.1f.

Hope some of this helps.

This topic is closed to new replies.

Advertisement