Create a Material for 4-Way Texture Blends

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

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 Blend Weights Texture Count setting should be set to 4 (ARGB).

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!

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback