5 Texture Blend Material Using HeightLerp in Unreal Engine
Objective: This is a quick tutorial showing the graph for a 5 texture blend material which can be painted on to a mesh using vertex blend weights. A blend map is used to make the transition between textures more natural. This tutorial assumes basic understanding of material composition in the Unreal Engine.
The Graph. Click to expand.
- 6 TextureSamples (can convert to parameters if making instances)
- 5 Vertex Color Nodes (see note below)
- 5 HeightLerp Nodes
- 1 OneMinus Node
- 1 ScalarParameter (set default value, 1 in this case)
- Connect everything together as shown in graph.
- Texture 1 Plugs into the B of the last Lerp and the A of the first Lerp.
- Textures 1 - 5 are the textures you will be mixing.
- The Blend Heightmap was created in Photoshop by using the Clouds filter on black and white, and then using the Difference Clouds filter. Simple. You could have a different blend for each texture.
- The Heightmap is inverted with a OneMinus. This seemed to yield the best blending.
- You can use just one VertexColor node to connect to the Lerps, but I seperate it out for redability. Things can start looking like a spider web once you start blending even more maps per material.
- If you run into having too many Samplers, set the Sampler Source to Shared: Wrap located in the TextureSamples Details Tab.
Use Vertex Weight Painting to apply your textures to a mesh. For Texture Weight Type choose ARGB -1. See screen below.
There is some slight bleeding along the blend under certain circumstances. The blend texture helps mitigate that rather substantially. For me it is a nonissue and not very noticeable unless using very contrasting textures. I did some testing though and came up with the following results which may be helpful.
- Textures 1 and 5 blend good with all textures.
- Slight bleeding occurs when blending 2, 3, and 4 on top of each other.
- 2, 3, and 4 each blend well when placed on top of 1 and 5.
Now for the material in use with some of my cave textures.