0
\$\begingroup\$

I'm trying to fake terrain blending by using an opacity mask on my road mesh to reveal the grass underneath. I'm currently multiplying some Perlin noise by a Rectangle node displaying my texture at 80% width which is giving me the following:

enter image description here

Obviously this doesn't look great for reasons that should be apparent. The blotches are unnaturally spaced and they abruptly end with a sharp line at the end of the texture. What I would like to do is generate noise that looks more along the lines of this:

enter image description here

Is there a way to apply some sort of gradient to my noise to achieve this? I know I can just use the texture itself but I would like to be able to adjust properties like the extent of the noise during runtime.

\$\endgroup\$
1

1 Answer 1

2
\$\begingroup\$

Here's one way to approach this:

Shader graph example

The main idea here is that we make a symmetric gradient across our UV space (using the y direction here because that's how my road mesh was set up) by subtracting 0.5 and thaking the absolute value.

Then we apply domain warping within that gradient - shifting the gradient value back & forth using the output of a noise node, with 0.5 subtracted to get the values to be symmetric about 0.

Now we can use this warped sample coordinate to look up into our gradient map, that controls the fall-off from opaque to transparent. You can also use math nodes for this, but you might find the gradient more intuitive to adjust by eye.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .