Blend Layer
The blend layer feature of the Illum shader allows mixing a second set of textures with the base set to get more variation on tiled surfaces.
The blending is primarily based on the vertex alpha channel and a generic blend map. The vertex alpha determines where the blend layer should be visible on the surface of the mesh. Independent from the geometry tesselation, you can achieve smooth as well as very sharp transitions between the layers. A low number of vertices is sufficient for good looking results.
A very useful feature of the blend layer is that a heightmap can be used as blend map. This makes the blending follow the structure of the base texture.

Example of the blend layer in an indoor environment.

Example of the blend layer on a brick wall with green moss.

3ds Max setup for a basic plane with 25 vertices.

In game asset with Illum shader and blend layer feature enabled.
The blend layer feature does not combine two generic materials, it rather blends specific textures of a single material. This means that the basic material settings apply to both layers. The blend layer can have an individual diffuse map, specular mask (in the alpha channel of the diffuse map) and a separate normal map. Usually, this gives enough control to get great results with good performance.
 | Shader values (spec intensity, glossiness) are applied to both layers (the base and the blend layer). |
3ds Max Asset Setup
 | The 3ds Max DirectX shader will be included in the next release of CryMaxTools. |
Add a vertex paint modifier to the stack and change the channel to vertex alpha. This is very important to separate, as you must use vertex alpha for this feature and not vertex color.
Open the objects property window of the asset and enable vertex color display, but change the display to vertex alpha. To be sure that you don’t paint the wrong channel you can always switch back and forth to vertex color preview.
 | All the textures are tiled and do not use unique UV shells. You cannot use a baked ambient OCC map in this case, but it is still possible to use baked vertex color shadows on the asset. |

Vertex alpha setup in 3ds Max.
You can use our blend shader for 3ds Max not just for previewing the result but also to paint your vertex alpha in real time.
Open up the material editor and switch the standard material to a DirectX shader where you can load the blend layer shader instead and get all the similar parameters of the sandbox editor to tweak the values.

Layer blend shader for preview in 3ds Max.
Sandbox Material Setup
The blend layer is only supported for the Illum shader, so make sure that your material uses that shader. In order to use the blend layer, you need to set up three texture maps:
- Custom: Diffuse map of blend layer (with specular mask in alpha)
- [1] Custom: Normal map of blend layer
- Opacity: The blend map (a generic grayscale texture, e.g. a noise texture, or a heightmap)
The blending can be enabled with the checkbox Blendlayer. Once active, three new shader parameters will show up:
- Blend Factor: Changes the overall blend factor. Use this to fade in and out the blend layer.
- Blend Mask Tiling: Specifies how often the blend layer textures are repeated (tiled). If you use heightmap that aligns with your base normal map, this parameter should usually be set to exactly 1.0, otherwise the blend layer textures are rotated to make them appear less repetitive.
- Blend Falloff: Specifies how smooth the transition between the layers should be. Use a high value for a sharp transition.
The blend map can be interpreted as if it would specify some height. This way you can have moss growing between the bricks. If the blend factor is increased, by changing the vertex alpha, blend map or strength slider, the moss will slowly begin to cover the surface of the bricks.

Example of Blend Layer setup in the Sandbox Material Editor.
The falloff can be useful to simulate different material types. With a high falloff value, you can get a hard blend, to simulate for example rust on a metal surface. A low value gives a much smoother transition, as you would have it for snow on the ground.
The blend factor should normally be set to 16. If you want to tweak the blending, you should do it in 3ds Max via the vertex alpha. If you lower the blend factor, you will lose range and control. A blend factor below 16 never allows you to reach the maximum blending.