BlendAlphaMode
Available since LÖVE 0.10.0 |
This enum is not supported in earlier versions. |
Different ways alpha affects color blending. See BlendMode and the BlendMode Formulas for additional notes.
Contents
Constants
- alphamultiply
- The alpha channel of what's drawn is multiplied with its RGB values. This is the default alpha mode.
- premultiplied
- The alpha channel of what's drawn is not multiplied with its RGB values ("premultiplied alpha blending"). This should generally be used when drawing a Canvas to the screen, for example, because the alpha values of the Canvas' texture had previously been multiplied with its RGB values when drawing content to the Canvas itself.
Notes
The "alphamultiply" constant does not affect the "multiply" BlendMode. Similarly, the "screen" BlendMode's math is only correct if the "premultiplied" alpha mode is used and the alpha of drawn objects has already been multiplied with its RGB values previously (possibly inside a shader.)
Several articles have been written about premultiplied alpha and when to use it:
- https://developer.nvidia.com/content/alpha-blending-pre-or-not-pre
- http://blogs.msdn.com/b/shawnhar/archive/2009/11/06/premultiplied-alpha.aspx
- http://blogs.msdn.com/b/shawnhar/archive/2009/11/07/premultiplied-alpha-and-image-composition.aspx
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info