Jump to content

  • Log In with Google      Sign In   
  • Create Account

Alpha Blending: To Pre or Not To Pre


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
5 replies to this topic

#1 LetsKillDave   Members   -  Reputation: 496

Like
0Likes
Like

Posted 01 February 2013 - 05:56 PM

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.


David "LetsKillDave" WellerNVIDIA Developer Programs ManagerPersonal blog http://letskilldave.comPersonal Twitterfeed: letskilldaveNVIDIA Developer Announcements Twitterfeed: nvidiadeveloper (clever name, eh? :-)

Sponsor:

#2 Assassin   Members   -  Reputation: 246

Like
0Likes
Like

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


Assassin, aka RedBeard. andyc.org

#3 JTippetts   Moderators   -  Reputation: 8472

Like
0Likes
Like

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.



#4 RobMaddison   Members   -  Reputation: 694

Like
0Likes
Like

Posted 03 February 2013 - 02:46 AM

When would you do the pre multiplying?

#5 Hodgman   Moderators   -  Reputation: 30349

Like
1Likes
Like

Posted 03 February 2013 - 08:09 AM

When would you do the pre multiplying?

If when authoring your texture, the transparent/background parts are black, then it's already done ;)

#6 RobMaddison   Members   -  Reputation: 694

Like
0Likes
Like

Posted 03 February 2013 - 09:22 AM

That's a much easier explanation - I like simple!




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