BlendMat

The BlendMat node sets how the pixels colored by the material it is applied to combine with the pixels from objects behind. It is like the MergeMat node, but instead of blending with another material, it blends with whatever is rendered behind in the 3D scene.

Note:  Multiple BlendMat operations on the same layer may produce unexpected results.

Inputs and Controls

Connection Type

Connection Name

Function

Input

unnamed

The 2D image you’re using for the material to merge with the background pixels in the 3D scene.

Control (UI)

Knob (Scripting)

Default Value

Function

BlendMat Tab

channels

channels

rgba

The effect is only applied to these channels.

You can use the checkboxes on the right to select individual channels.

operation

operation

over

Select how you want to composite the BlendMat node’s input material and the background pixels together:

none - set the material to black.

replace - show the material where the material and the background overlap.

over - composite the material over the background pixels according to the material’s alpha.

stencil - show the background pixels where the material’s alpha is black. Where the material’s alpha is white, the material is set to black. For this to work, the BlendMat node needs to process the alpha channel, so set channels to rgba. This operation is the opposite of mask.

mask - show the background pixels where the material’s alpha is white. Where the material’s alpha is black, the material is also set to black. For this to work, the BlendMat node needs to process the alpha channel, so set channels to rgba. This operation is the opposite of stencil.

plus - add the background pixels to the material.

max - use the material if its pixel values are greater than the background pixels or else use the background pixels.

min - use the material if its pixel values are less than the background pixels or else use the background pixels.

surface blend

surfaceblend

input fragment

Determines how the input texture blends with the vertex color of the geometry to which the shader is applied:

input texture - only use the input texture.

vertex color - only use the vertex color.

modulate - texture * vertex color.

plus - texture + vertex color.

over - (texture + ((1 - a) * vertex color)).

subtract - texture - vertex color.

Step-by-Step Guides

Merging a Material with the Objects Behind