Create a Material for 4-Way Texture Blends

This page describes how to set up materials for 4-way (ARGB) texture blending.

Choose your operating system:

Windows

macOS

Linux

To handle 4 textures in the blend weights setup, you need to create a Material similar to this:

4-way_material.png

This works very similarly to the 3-way Material graph, but brings Alpha into the mix to give a 4th blending option. Here is what is happening:

  • Each of the color channels (ARGB) gets its own Linear Interpolation expression.

  • Each texture plugs into the B input of its corresponding Lerp node.

  • The Lerp corresponding to Texture 1 plugs into the Material, and its Alpha will be driven by the Alpha channel from the vertex color.

  • The Lerp corresponding to Texture 2 plugs into the A input of the Lerp corresponding to Texture 1, and its Alpha will be driven by the Red channel from the vertex color.

  • The Lerp corresponding to Texture 3 plugs into the A input of the Lerp corresponding to Texture 2, and its Alpha will be driven by the Green channel from the vertex color.

  • The Lerp corresponding to Texture 4 plugs into the A input of the Lerp corresponding to Texture 3, and its Alpha will be driven by the Blue channel from the vertex color.

  • Texture one also wraps around and becomes the A plug for the 4th and final Lerp. This makes Texture 1 the default texture.

Once this is set up, the Mesh Weight Painting Tool should be active and the Texture Weight Type setting should be set to ARGB (Four Textures) .

4-Way_Setting.png

Here is an example of this Material, first with the Mesh viewed in RGB Mode, showing the vertex colors in place. Note that with this setup, alpha (shown black) corresponds to Texture 1, red corresponds to Texture 2, green corresponds to Texture 3, and blue corresponds to Texture 4.

4-Way_RGB.png

And here is the final result:

4-way_Result.png

Notice that where the vertex color in the first image is black (Texture 1) there is no change. This is because Texture 1 is also plugged into the A input of the 4th Lerp expression (see above), making it the default texture. Essentially, you start with Texture 1 and can paint Textures 2, 3, and 4 down as you see fit, or paint Texture 1 back down over them at any time.

If you were going to be setting up such a Material over and over, this would be a great place to deploy a custom Material Function !

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss