Jump to content
  • Advertisement
Sign in to follow this  
Bluud

Problem with AA and 2D screen elements

This topic is 3903 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

Hi, I have a directX9 3D engine and want to enable anti-aliasing. When I set the present parameters.MultiSampleType to anything other than D3DMULTISAMPLE_NONE the 3D looks fine, but the 2D interface is misaligned with 1-pixel gaps at the joins and other artefacts. Can I disable anti-aliasing on the 2D interface? I am thinking maybe I could use a pixel shader and perform anti-aliasing before the 2D is drawn - would this be slower than using the hardware flag? thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
thanks that is a good read.

I think my problem is slightly different though. My problem is that two 2D elements that appear to sit next to each other with no multisampling (i.e/ no gap between them) appear to be one pixel apart once the multisampling is enabled.

Share this post


Link to post
Share on other sites
Quote:
Original post by Bluud
thanks that is a good read.

I think my problem is slightly different though. My problem is that two 2D elements that appear to sit next to each other with no multisampling (i.e/ no gap between them) appear to be one pixel apart once the multisampling is enabled.


I'm not sure if there is an easy way to do what you want to do... Don't quote me on that, but I've seen many retail games suffer from this same dilema (although it's not as obvious since their ui elements either take this into account or are very basic anyway (fps games, etc)

Share this post


Link to post
Share on other sites
You can turn turn off multisampling by calling IDirect3DDevice9::SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, FALSE ). Just do that before rendering your UI, and everything should be peachy.

Share this post


Link to post
Share on other sites
ah thank you MJP this has saved me! I was about to totally rewrite the way my UI is rendered until you told me that you could disable AA per object! Fantastic !

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!