Merge
Composites a foreground image over a background using Porter-Duff alpha compositing with blend modes.
Category: Composite Menu path: Composite > Merge
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
fg | imageRgba16f | input | Foreground image (composited on top) |
bg | imageRgba16f | input | Background image (composited behind) |
out | imageRgba16f | output | Composited result |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
blendMode | enum | Normal | Blend mode for compositing. Options: Normal, Add, Multiply, Screen, Overlay. Keyframeable. |
opacity | scalar | 1.0 | Foreground opacity (0 = fully transparent, 1 = fully opaque). Keyframeable. |
How It Works
The shader applies the selected blend function to the foreground and background colors, then composites the result using the Porter-Duff "over" operator with premultiplied alpha.
Blend Modes
- Normal -- foreground replaces background where it has alpha
- Add -- foreground + background (brightens, good for light effects)
- Multiply -- foreground x background (darkens, good for shadows and texture overlay)
- Screen -- inverse of multiply: fg + bg - fg x bg (lightens, good for glows)
- Overlay -- multiply where background is dark, screen where background is bright (contrast enhancement)
The opacity parameter scales the foreground's alpha before blending, so reducing opacity fades the foreground contribution.
Usage Examples
Basic: Layer two images
- Connect the top image to
fgand the bottom image tobg - Leave blend mode on Normal and adjust opacity
- This is the same operation the timeline does when compositing layers, but within a single layer's node graph
Creative: Light effects with Add
- Connect a glow or particle render to
fg - Connect the scene to
bg - Set blend mode to
Addfor additive light blending where bright areas stack
Advanced: Texture overlay
- Connect a texture or grunge image to
fg - Connect your main image to
bg - Set blend mode to
Multiplyand reduce opacity to 0.3-0.5 for a subtle darkening texture overlay - Try
Overlayinstead for texture that affects both highlights and shadows
Tips
- Merge is the same compositing operation the engine uses for layer compositing in the timeline. Use it within a node graph when you need to combine textures at an intermediate stage.
- The Output node provides blend mode and opacity for final layer compositing. You only need Merge for in-graph compositing.
Addmode can push values above 1.0 in the linear working space, which is useful for HDR-style effects.- When only
fgis connected (nobg), the result is the foreground with opacity applied.