MergeLayer

The MergeLayer node combines two input shaders to produce a composite of the two. The default merge operation is A over B, but several other Operations are available, such as stencil and mask.

Inputs and Controls

Connection Type

Connection Name

Function

Input

A

The two shaders you want to merge. The default merge operation is A over B.

B

Control (UI)

Knob (Scripting)

Default Value

Function

MergeLayer Tab

Channels

channels

rgba

The shader merge is only applied to these channels.

If you set this to something other than all or none, you can use the checkboxes on the right to select individual channels.

Also Merge

also_merge

none

Sets the shader channels that are merged in addition to those specified in the channels control.

Operation

operation

over

Sets the merge operation to use:

none - No merge is calculated, only shader B affects the output.

replace - Replaces shader B with shader A.

over - This is the default operation. Layers shader A over B according to the alpha of shader A. Algorithm: A+B(1-a)

stencil - Only shows the areas of shader B that do not overlap with the alpha of A. Algorithm: B(1-a)

mask - Only shows the areas of shader B that overlap with the alpha of A. Algorithm: Ba

plus - The sum of image A and B. Note that plus may result in pixel values higher than 1.0. Algorithm: A+B

max - Takes the maximum values of both shaders. Algorithm: max(A,B)

min - Takes the minimum values of both images. Algorithm: min(A,B)