Advanced Texture Splatting

From Shader Forge Wiki
Jump to: navigation, search

The blending of textures when using Texture Splatting doesn't need to be linear by any means, you can modulate it to achieve more interesting results! Here's an example of making the secondary texture have a tendency towards higher blend values in darker areas of the second textures alpha channel, in this case resulting in the bark texture showing up mainly in the grooves in between the bricks:

Blend-modulation-example1.png


Advance blending using height maps

Another way to improve this blend, especially for terrain textures, is to use a height map for each texture to resolve the blend.

Imagine that we have a stone walkway with cracks between the stone. If the sand was blowing up from the ocean, we would expect the sand to fill up the cracks of the walkway before covering the walkway. We can re-create this type of effect for our blending using a height map.

The simplest way to do this is to generate the mask for our Lerp node using the step function:

Sf heightblend step.png

And while this is much improved, because it uses the step function, each pixel will only be one texture or the other; there will be no blending between the pixels. Ideally, we'd like some control over the blending between these two textures, allowing a small blend to happen between our surfaces. This can be accomplished with a little extra math, giving us a controllable blend size and contrast.

Sf heightblend great.png

and here is the final shader if you'd like to play with it File:Height lerp.shader