Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Enabling Transparency AA In DX9 On ATI Cards


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 andur   Members   -  Reputation: 731

Like
0Likes
Like

Posted 11 August 2008 - 10:59 AM

Is there a way of enabling transparency anti-aliasing in DX9 on ATI cards? I tried this method from Nvidia: (http://developer.nvidia.com/object/devnews028.html see the tip of the month section) pd3dDevice-> SetRenderState(D3DRS_ADAPTIVETESS_Y, (D3DFORMAT)MAKEFOURCC('S', 'S', 'A', 'A')); And while that works on Nvidia cards, it has no effect on any Ati cards.

Sponsor:

#2 coderchris   Members   -  Reputation: 264

Like
0Likes
Like

Posted 11 August 2008 - 12:59 PM


pd3dDevice->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('A','2','M','1'));


that should do the trick. I havent actually been able to test it myself yet, let me know if it works

#3 andur   Members   -  Reputation: 731

Like
0Likes
Like

Posted 11 August 2008 - 01:27 PM

Doesn't work on my X1600 card at home here, I'll have to try it out on the fancier cards I've got at work tomorrow.

Now, is that the FourCC code for multi-sampled aa or super-sampled aa? The super-sampled aa looked far better on the Nvidia card (7950) that I tried it out on. (the multi-sampled method had a really weird blur pattern that really broke down up close, and still shimmered some from a distance)

Oh, and where'd you find that code from anyways?

#4 coderchris   Members   -  Reputation: 264

Like
0Likes
Like

Posted 11 August 2008 - 03:14 PM

Hmm, yeah it may only work on their newer cards. That four-c is for multisampled AA. To my knoledge, there are no radeon cards that support supersampled AA (correct me if im wrong).

I agree though, supersampled looks so much better than multisampled.

I got that from one of the examples in the ATI SDK (cant remember which one):
http://developer.amd.com/gpu/radeon/pages/RadeonSDKSamplesDocuments.aspx#d3d9

You might try turning on standard multisampling if you havent already. I remember I had to do that to get it working on my nvidia card.

#5 andur   Members   -  Reputation: 731

Like
0Likes
Like

Posted 12 August 2008 - 04:09 AM

The A2M1 code enables some sort of transparency AA on a radeon 2900 and above, though its kind of an ugly 3-banded blur around the objects. I can't find a way of enabling super-sampling with it. I may just need to roll a custom shader of some sort to consistently deal with softening the masked edges.

And I do have standard multisampling AA turned on as well.

#6 SuperCow73   Members   -  Reputation: 122

Like
0Likes
Like

Posted 12 August 2008 - 06:21 AM

The A2M1 FourCC enables the "Alpha to coverage" feature (also called "Alpha To Mask" hence the FourCC name), which converts the alpha output from the pixel shader into a multisampling coverage mask. Thus for instance an alpha value around 0.5 would result in 2 samples being "on" and 2 samples being "off" on a 4-sample multisampling configuration. This technique should really only be used in combination with MSAA as otherwise a dithering effect will be seen on single-sample configurations. After MSAA resolves Alpha to Coverage results in smooth edges around transparent geometry (the level of smoothness depending on the number of multisamples being used).
Alpha to coverage is different (and cheaper) than "supersample AA" that nVidia exposes through another backdoor; supersample AA simply mutipass transparent geometry (one pass per sample) so that each multisample is aligned with the pixel centre at each pass. Each pass only outputs into a single sample, so you're paying the full cost of supersampling your transparent geometry (on top of the extra geometry cost). Of course this will look better than alpha to coverage (but is also more costly). Off the top of my head supersample AA could also be implemented manually by adjusting the projection matrix each pass and setting the D3DRS_MULTISAMPLEMASK renderstate to write to the selected sample each pass).


#7 gzboli   Members   -  Reputation: 122

Like
0Likes
Like

Posted 12 August 2008 - 12:40 PM

Alpha to Coverage:
pd3dDevice->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('A','2','M','1'));


Instancing:
pDev->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('I','N','S','T'));



Am I missing something here? Or are AtC and Instancing mutually exclusive because they both use POINTSIZE?

#8 andur   Members   -  Reputation: 731

Like
0Likes
Like

Posted 12 August 2008 - 01:37 PM

Quote:
Original post by gzboli
Alpha to Coverage:
pd3dDevice->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('A','2','M','1'));


Instancing:
pDev->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('I','N','S','T'));



Am I missing something here? Or are AtC and Instancing mutually exclusive because they both use POINTSIZE?


That seems to be the case, tracing through:

DWORD ps;
this->device->GetRenderState(D3DRS_POINTSIZE, &ps);
this->device->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('A','2','M','1'));
this->device->GetRenderState(D3DRS_POINTSIZE, &ps);

does show that the value of the point size render state is changing. Now, I imagine that the driver is intercepting that and internally changing its own state somewhere indicating that AtC or Instancing is active, but, I really don't know for sure. Try it and find out!





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS