The Layers device provides a convenient way to combine together many different inputs, using an interface similar to Photoshop.
The Layers device supports heightfields, bitmaps, and full materials. You can use a variety of compositing operations, including powerful heightblend-based options. It also produces output masks showing how much of each layer survived into the final blend.
Set the desired number of inputs by setting the “Number of Layers” slider. An input will be created for each layer, along with the corresponding parameters.
The input layers are evaluated top to bottom; Later entries occlude the ones above them in the list.
The layer parameters are:
- Opacity : Fade the layer strength. If a layer mask was provided, the layer mask and opacity are multiplied.
- Operation: How to combine the layer with the existing layers above it. The available options are:
- Layer Over. This is a traditional ‘alpha blend’, equivalent to using a Chooser.
- Layer Under. This unique option places a layer behind all existing layers. Note that this only works if the preceding layers have partially-transparent alpha channels; logically, you can’t see a layer placed behind another fully opaque layer.
- Layer Add. Mathematically add to the existing content. This is very useful when the layer weights have already been appropriately set, such as with a Weightmap device
- Heightblend Replace. The current layer is heightblended with the existing layers. Areas at full opacity reduce the height-weight of the previous layers such that they are guaranteed to appear.
- Heightblend Merge. Areas of the current layer higher than the current highest heightblend value will appear. Only areas that are higher than the existing layers will appear.
- Premultiplied Alpha: Available for heightfield and bitmaps, check this if the input has already been alpha-masked. For more details about alpha masking, take a look at the Compositing help article. This a relatively advanced option and generally speaking if you need to do this, you’ll know.
Each layer you create contains both a data input and a mask input:
- The data input can be a heightfield, bitmap, or material. All inputs must be the same type.
- The mask input is optional, and must be a heightfield. No mask input is treated the same as a mask that is all-white.
- The Primary Output contains the blended result of the Layering operation.
- The Composite Mask contains the resulting alpha channel. This is often fully white (value 1.0), however if you are compositing masked inputs your result may not fully cover every pixel, which is perfectly OK.
- Each layer outputs a mask that shows what part of that layer survived into the final blend.
Tips and Tricks
The Layer device replaces the previously idiomatic “Cascading Choosers” that you would use to combine multiple texture layers within World Machine.
The layer parameters currently cannot be controlled by external parameter inputs, such as from a Macro Parameter device. If you need to programmatically control the blending, use a Chooser to blend the layer instead.