Skip to main content

Blending

Alpha Blending is the process of combining the pixel data of multiple overlapping objects to a single pixel with a final color and alpha value.

drawing-4-1677552833.png

Blend Factor

Here is an example on the different blend factors using alpha blending:

drawing-4-1677552811.png

Alpha is 1.0 (white) for non-transparent pixels and 0.0 (black) for transparent pixels.

Blend Operation

The blend operation specifies how the destination and source pixel values are combined. Here is an example blending 50% red on opaque blue:

drawing-4-1677552792.png

Blend Problems

The default values used for blending are set to the following configuration:

drawing-4-1677552782.png

The default values ensure maximum performance when no layer blending is needed or no objects with transparency on the same layer are overlapping. The reason is that the Destination Alpha is multiplied with 0 (ignored) and the Source Alpha is used instead. This means the transparency of the last drawn item is used. The default Color Blend Values are fine for all common cases.

In the following example, a partially transparent 2D scene on one layer is rendered over a 3D scene of another layer.

drawing-5-1760709992.png
  Default Alpha Blend Values Corrected Alpha Blend Values
Configuration

Alpha Blend Factor Src One InverseDestAlpha
Alpha Blend Factor Dst Zero One
Alpha Blend Operation Addd Add
Problem caused by

- Scene using layers

- Overlapping objects with transparency


Reason Destination Alpha is multiplied with 0 (ignored), and the source Alpha is used instead. Therefore, the transparency of the last drawn item is used and the background layer with the 3D scene is partially visible. With the corrected Alpha Blend vales, the transparency of the SolidColorNodes is applied as intended and the background layer is not visible.

Alpha blending is disabled by default. Blending should not be enabled unless really necessary. Unnecessarily enabling blending will lead to a performance loss. When using images with alpha information, blending can be enabled in the Solutions Options dialog: “File – Solution Options… - Default Render Mode – Enable Blending”