Language:
Page Info
Skill Level:
Engine Version:

3-Way Blend Materials

Choose your OS:

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:

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 !