Click or drag to resize
AB4D logo

CommonStatesAlphaToCoverage Property

Alpha-to-coverage blend state. See remarks for more information.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.1.9105.2048 (1.0.0.0)
Syntax
C#
public BlendState AlphaToCoverage { get; }

Property Value

BlendState
Remarks

When using alpha-to-coverage then the graphics card determines if the pixel is transparent or opaque based on the color's alpha value (when alpha is less the 0.5 then pixel is fully transparent; otherwise the pixel is fully opaque).

What is more, when using MSAA (multi-sample anti-aliasing) then the level of transparency can be defined more accurately with making some sub-pixel samples transparent and some opaque (for example when using 8 x MSAA then each pixel's color is calculated with combining 8 sub-pixel samples; when alpha-to-coverage is enabled and alpha value is 0.25 (=2/8) then 2 of the samples will be transparent and 6 will be opaque). This way it is possible to create smoother transitions from fully transparent to fully opaque regions. This technique does not produce as accurate results as standard alpha blending, but a big advantage is that it does not require objects to be sorted (and rendered) from those that are farthest away to those that are closest to the camera (and the results are still very good for some use cases - especially when the textures has small transitions from transparent to opaque).

See Also