The layer_RGBA shader can be used to linearly layer up to eight shaders together, enabling you to create complex shading effects. Layers are applied in order (bottom to top) according to a blending mode specified in the operation. The layer alpha can optionally be a separate input. A use for this shader could include adding text to an image for example.
Enable (1-8)
Enable/disable the layer entirely.
Swap Inputs (1-8)
Swaps the input of the current and the selected layers.
Move (1-8)
Moves the current layer in place of the selected layer, pushing the other layers up or down, changing the order of the layers. For instance, if layer 2 is moved in place of layer 5, the new order is (bottom to top): layer 1, layer 3, layer 4, layer 5, layer 2, layer 6, layer 7, layer 8.
Name (1-8)
Layer name.
Input (1-8)
Input value for Layer.
Mix (1-8)
Controls the amount of blending between shaders. You may need to insert a range shader when connecting a bitmap to mix.
Operation (1-8)
The blending mode for the current layer. They emulate all of Nuke and Photoshop's modes. In the formulas, A (layer_1) is the upstream intermediate result, and B (layer_2) is the current layer.
Normal Map
It is possible to blend multiple normal maps using the normal map blending operation.
Alpha Operation (1-8)
Optional alpha value for Layer. Result: The alpha is computed in the same way as the other color channels (follows the "operation" for the RGB channel). Preserve: Keeps the old alpha value ( A.a ). Overwrite: The alpha channel is overwritten by the alpha of the current layer ( B.a ). Mask: Calculated as: A.a + B.a - A.a * B.a.
Clamp
Clamp all intermediate results to [0,1].
Example of layer_RGBA shader used to layer Arnold graffiti texture onto brick texture