Just a quick note to let folks know that NVIDIA's John McDonald just posted a nice article on alpha blending called "Alpha Blending: To Pre or Not To Pre".
This blog post includes a nice WebGL demo demonstrating the concepts as well.
Alpha Blending: To Pre or Not To Pre
#1 Members - Reputation: 496
Posted 01 February 2013 - 05:56 PM
#2 Members - Reputation: 242
Posted 01 February 2013 - 07:43 PM
Another useful article on the topic of pre-multiplied alpha, from Shawn Hargreaves:
http://blogs.msdn.com/b/shawnhar/archive/2009/11/06/premultiplied-alpha.aspx
#3 Moderators - Reputation: 5221
Posted 01 February 2013 - 11:02 PM
I like to use pre-multiplied alpha in GC, but there is one thing I've had to be aware of, and that is alpha testing. With regular alpha, you can alpha-test and discard fragments with an alpha of 0 (fully transparent), saving a little bit of fill rate. However, there are usage cases with pre-mult alpha in which you want to draw those 0-alpha pixels (since it equates to an additive blend if RGB is non-0) but with alpha-testing they'll get discarded. Just a little something to be aware of if you find yourself having an issue.






