Jump to content
  • Advertisement
Sign in to follow this  
danromeo

Pixel over pixel....how?

This topic is 3049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!