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.
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 Result
Clamp all intermediate results to [0,1].
Example of layer_RGBA shader used to layer a graffiti texture onto a brick texture