Remember what we learned about premultiplied alpha in CS148?

Well, I don’t, because I wasn’t paying attention to that at all. I was probably playing tetris during that lecture (though I’m fairly sure I did actually go to that one).

But I understand it now! Because XNA uses premultiplied alpha as its default, and thanks to a helpful explanation.

Normally you wouldn’t have to worry about any of it because XNA makes it all seem like it doesn’t exist, with the exception of text colors, which you have to use their helper function FromNonPremultiplied for. But I’m doing an HSV shader so I can have HSV modification instead of plain ol tinting when I use their draw code, so I need to unpremultiply and then repremultiply it.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s