Blend two textures using noise

I want to be able to blend two textures using the black and white values of the noise node. Here is what i currently have:
image

But i want the lines between the two colours to be blurred. Heres my current node setup:


Im using placeholder Vector 3 colours for now.

I see my approach of using the ‘if’ node is causing issues, where the values are either only black or only white, but I dont know what else to use as I’m not too familiar with creating amterials

One word: Lerp :slight_smile:

2 Likes

HowTo:

Otherwise, IIRC, IF statements require both branches to be calculated, and whilst they CAN be efficient if used well, the can also very easily NOT be. A LERP is generally one-of the most efficient operations on a card and is very nest-able in code.

I liken LERP to Lurch from the Addams family: that guy’s butt is everywhere and he does all my heavy-lifting.

In this case, the LERP assumes a value of 0-1 in the alpha, but it doesn’t have to be that, you can use more-less if you want to in your code. Otherwise, whatever is 0 in the alpha is 100% the A input and 0% the B input. As the alpha increases to 1, it blends to the B input such that .25 is 75% A, 25% B, .5 is 50/50 and 1 is all B no A. Alpha-values outside this range just give you more of that ‘end’.

Fuzzyness will be controlled by how sharp the values transition from 0 → 1. CheapContrast works here, but I personally use another LERP on the alpha, with scalar-inputs on A/B, followed by a saturate to clamp the values:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.