Create a Material for 3-Way Texture Blends

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

Windows
MacOS
Linux

Blending 3 separate textures can be handled by the Mesh Paint tool very easily, but it does require a special setup in the material. Consider the following graph:

3-WayBlend.png

Here is an overview of the setup:

  • Each of the color channels (RGB) 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 Red 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 Green 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 Blue channel from the vertex color.

  • Texture one also wraps around and becomes the A plug for the 3rd 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 3 (RGB).

3-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, red corresponds to Texture 1, green corresponds to Texture 2, and blue corresponds to Texture 3.

3_way_vertexColors.png

And here is the final result:

3_way_Result.png

Notice that where the vertex color in the first image is red (Texture 1) there is no change. This is because Texture 1 is also plugged into the A input of the 3rd Lerp expression (see above), making it the default texture. Essentially, you start with Texture 1 and can paint Textures 2 and 3 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 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