Jump to content
  • Advertisement
Sign in to follow this  
Lifepower

Line antialiasing + caps + multisampling

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

I have encountered an unusual behavior on my Nvidia Geforce 7600 GS. Apparently, it has "D3DLINECAPS_ANTIALIAS" flag disabled in LineCaps, but the video card *does* line antialiasing! Also, DirectX SDK under D3DRS_ANTIALIASEDLINEENABLE states:
Quote:
When rendering to a multisample render target, D3DRS_ANTIALIASEDLINEENABLE is ignored and all lines are rendered aliased. Use ID3DXLine for antialiased line rendering in a multisample render target.
Apparently, this is not true. When using 4x multisampling (D3DMULTISAMPLE_4_SAMPLES), if I enable ANTIALIASEDLINEENABLE flag, lines are rendered with double antialiasing. That is, the line is rendered with antialiasing and then multisampling is applied to it. As a result, the lines appear somewhat ugglier and thinner than they should. So the situation is the following: 1) D3DLINECAPS_ANTIALIAS flag is not set in LineCaps! 2) D3DRS_ANTIALIASEDLINEENABLE set to true and using D3DMULTISAMPLE_NONE: lines are rendered antialiased. This is unexpected, because D3DLINECAPS_ANTIALIAS is not set! 3) D3DRS_ANTIALIASEDLINEENABLE set to false and using D3DMULTISAMPLE_NONE: lines are aliased. This is expected. 4) D3DRS_ANTIALIASEDLINEENABLE set to false and using D3DMULTISAMPLE_4_SAMPLES: lines are antialiased. According to DirectX SDK, this is unexpected (check the quote above). 5) D3DRS_ANTIALIASEDLINEENABLE set to true and using D3DMULTISAMPLE_4_SAMPLES: lines are antialiased and blurred even further. Seems logical, but not expected according to DirectX SDK. With the above behavior, when using multisampling I set D3DRS_MULTISAMPLEANTIALIAS to False and D3DRS_ANTIALIASEDLINEENABLE to true, which gives proper antialiasing for lines. This approach, basically, disables multisampling when using antialiased lines. However, I cannot predict whether line antialiasing is or not supported on a specific machine because D3DLINECAPS_ANTIALIAS flag in LineCaps is lying. Is this a driver problem or D3DLINECAPS_ANTIALIAS in LineCaps is simply not reliable?

Share this post


Link to post
Share on other sites
Advertisement
If I had to guess, it sounds like the drivers are bad. Especially the bit where it shows up in the caps but still renders with AA. Sounds like AA lines are not terribly reliable. I bet they don't get a lot of test time.

Share this post


Link to post
Share on other sites
The interesting thing is that many Nvidia cards have D3DLINECAPS_ANTIALIAS disabled, but I also saw antialiased lines rendered properly on Nvidia GeForce 6600 GT.

I can't immediately confirm this, but I also remember seeing that my lines had antialias with D3DRS_ANTIALIASEDLINEENABLE on GeForce FX 5200.

Lines antialiased with D3DRS_ANTIALIASEDLINEENABLE enabled look considerably better than those with D3DRS_ANTIALIASEDLINEENABLE disabled and using multisampling (although on my ATI Radeon X1600 Pro with 6x multisampling they are equally good).

Seems like I shouldn't rely on capability flag? [sad]

Share this post


Link to post
Share on other sites
Sounds like a driver bug, but working somewhat in your favour. nVidia specifically disabled AA lines. They enable it in the Quadro cards for professional CAD users. The cards can all do it, but the driver should be inhibiting it unless you pay for the expensive card.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!