Anti-aliasing problems DirectX

Started by
24 comments, last by ajoling 20 years, 2 months ago
Then it''s just one white square .

Hm. The test thing you made yourself, If it''s C(++) or something, I can probably read it .

And I''m going to test it on a different computer (which is a few generations younger than this one ) later today when I''m back from work.
www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>
Advertisement
Not sure if you already know this but I thought I'd try to help anyways:

3dsmax automatically generates an alpha channel that is PERFECTLY what you need. Just make sure you save the image in a format that supports alpha (eg. TGA is the easiest). Also in Max, MAKE SURE that in the format settings ("Setup" button in save dialog I think), you DISABLE "pre-multiplied alpha" (ie. clear the checkbox).

Then your program should load it all in correctly and display it perfectly. I've never had a problem with this technique, except as I stated: that pre-multipled alpha is bad, bad, bad


Also note that PSP has a problem saving TGA files in that it ALWAYS premultiplies the alpha... there is a workaround (through a plugin), that I can get the link for when I get home if you wish. Realize that for your image to look correct with the alpha channel, it will look BAD without it. Premultiplied alpha tries to correct this problem, but as you have noted, it tends to mess up some other things.

[edited by - AndyTX on February 13, 2004 11:37:00 AM]
Hmm, that could be the problem. But how should the renderstates be then? I''m tryin every combination right now. The one time, the mirror is alright, but with a black background (no change). And the other time it''s a mirror.. with a white surrounding! I never get it to show the mirror only
www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>
Don could you maybe send me that little demo you made? I''m curious if it works overhere. I just made a demo myself which tries 6 different renderstate combinations, one row is a mirror, with a white surrounding (just the black turning white)

Now, while I typed this, I was wondering about alpha testing. Which seems to do the trick. But then, I''m still having a white surrounding . So I''m wondering if you could e-mail it to me or something (see my profile). Would be great!

www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>
Rather than send you my code, I''ve modified one of the D3D9 SDK tutorial samples to load the .tga texture generated by using your black background image and alpha map, and render it on a centered quad. I''ve put the merged 32x32 tga texture in the zip file.

Zip file here.

Hm, this is getting slighly annoying by now . I''ve copied all renderstates, and everything.

Result:



With your renderstates, and the colorop with "PM"

Without



Which is the same again.. very aliased borders. I have checked the caps of my device, and it DOES support the D3DTOP_BLENDTEXTUREALPHAPM texture operation. If you have some freetime, could you compile your example to exe? I''m wondering if it''s an 32/16bit issue... Or check out my exe at this link

www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>

This topic is closed to new replies.

Advertisement