05:36 pm - A minor graphics fact explained far more politely than I ever could hope to.
Specifically, why premultiplied alpha is all you should use for shipping products
which boils down to three basic facts:
Less math (dramatically in more complex cases like shadowing and imposter's) to combine premultiplied images for compositing. Especially for more advanced things like imposter's (render a far-away tree once to a texture, render the texture) and other tricks useful for ultra-high-poly and ultra-low-power situations.
Removed halos, it's equivalent to the GIF versus PNG situation when changing the background color, PNG's won't halo. Neither will premultiplied alpha images. This also results in better compression. Yes, better compression. You don't have to bother with stupidity like flood-filling your transparent areas with their edge-colours, transparent is black, things just work, fewer colors = better compression.
You don't need separate additive and lerp/alpha-blending modes in your system. Hell, you can discard the 'opaque' mode in many cases, since premultiplied alpha can do additive, normal alpha-blending, and opaque rendering all at once, with overlapping handled correctly. Why? Because premultiplied alpha is associative
(which is also why it works so well for imposter's) so you can render see-through window A before B, or B before A, and get the same result. Note that again, rendering order mostly doesn't matter with premultiplied alpha.4 comments