4 ms·
Well... if we're trying to model how a translucent pane would work in the real world, then this is correct for one particular interpretation of alpha. However,
by Diggsey 5y ago
Well... if we're trying to model how a translucent pane would work in the real world, then this is correct for one particular interpretation of alpha.
However, if we're talking about how alpha blending actually works in software, then it can vary a lot.
For example, in Direct3D you would typically use the `D3DBLEND_SRCALPHA` and `D3DBLEND_INVSRCALPHA` for the source and destination blend modes respectively. In that case, the combined alpha is actually `src_alpha^2 + (1 - src_alpha) * dst_alpha` which is different again from the two calculations in the article.
There are even other ways to achieve a physically realistic result that use a different interpretation of the alpha channel. Or maybe you want to solve for something else (eg. order-independent blending)