redshock

I am creating a old-style RPG with added bells and whistles and it uses XNA. I threw a character in the game and he has a pink outline around him which is actually what I use for the transparent color. Do I need to do anything in code to remove this I thought I did something similar in Direct3D before when I was first creating the texture. Since GSE does it all for me, I'm getting an unwanted result.

Screenshot:

http://lh5.google.com/image/philvaira/RZ2EQXve37I/AAAAAAAAAAs/rx381x00kQA/Nral_Alpha_Screenshot_1.PNG.jpg imgmax=800

At any rate, this is my first project using XNA. I have a local team and we are finally putting it into production as commercial-based PC game. Using XNA has really boosted our productivity. For example, my artists don't have to wait long to see results in how their art fits in with the game. At any rate, performance is great and not once have I used a pointer yet :) Lots more to do...



Re: XNA Framework First XNA project & a question regarding pink outlining

Jim Perry

I'm getting a "forbidden" error from that link.




Re: XNA Framework First XNA project & a question regarding pink outlining

redshock

Thanks for letting me know. It seems to work for people outside of this website. You might copy/paste the url onto a web browser and see if it works that way. If not, I'm sorry about that. I'm new to Google Photo and still figuring it out.



Re: XNA Framework First XNA project & a question regarding pink outlining

Bill Reiss

It's probably some antialiasing that is happening around the edges of your sprite which are a slightly off-magenta color. If you want to antialias your sprites you should save them with a transparent background in PNG or some other format which supports alpha channels or transparency.




Re: XNA Framework First XNA project & a question regarding pink outlining

Jon Watte

It is not anti-aliasing, it is texture filtering.

When you want a texture to be transparent, you should create it with alpha, not use chroma keying. Chroma keying is a broken concept, that gets annoying artifacts unless you're drawing things in a rectilinear fashion with a 1:1 pixel:texel scale. (I'm pretty upset that chroma keying is the default for processing XNA textures in all the texture processor modes, btw.)

To create a transparent texture that works well, either smear all the alpha tested pixels to the colors of their opaque neighbors, and use SRCALPHA:INVSRCALPHA blending, or make all transparent pixels black, and use ONE:INVSRCALPHA blending. The latter (pre-multiplied alpha) is better, and can actually be done using DXT1 compression (as it supports 1-bit alpha where transparency is black).






Re: XNA Framework First XNA project & a question regarding pink outlining

redshock

Texture filtering seems the likely cause. I'll check on that, thanks.