I am trying to create a procedural material with the musgrave node that is very dense (black) on the bottom of my plane and then fades into white. However, using the gradient node I can only create a soft fade where there are greys in between or this harsh line as seen in the picture. Ideally, I am looking at a constant black and white colors only that the density of my texture fades out.

Please let me know if you have any suggestions

x Tenter image description here


1 Answer 1


It looks like you almost figured it out, your bottom-most Color Ramp controls the amount of white nicely:

The problem is, the plane is still not filled with white when the white slider moves all the way to the left. This is because a Color Ramp expects an input in range $0…1$, so anything below $0$ is clamped to (becomes) $0$, and everything above $1$ is clamped to $1$. Meanwhile, some Heights are below $0$

The general solution is to find out what's the minimum possible value that can go to the color ramp, what's the maximum possible value, and use a Map Range node to normalize that range (convert to $0…1$):

The GIF size limit forces grotesque inaccuracy but the idea is you can also increase the scale and play with the parameters that are expected to change to discover what are the minima and maxima (you could read the documentation instead, but don't trust the docs too much…). And more importantly, you can often add some safety margin and increase/decrease the maximum/minimum some more.

However, in your case you're not going to animate the movement of Color Ramp slider, so you would need to alter the input to the Color Ramp. and with that, you don't need to map range:

But in this case, the Color Ramp is not needed:

Gradient across $y$ axis

To modify the threshold based on $y$ axis instead of $t$ axis… Simply plug the $y$ coordinate instead of time. I added an additional Math: Multiply Add node to further offset the gradient to your liking (add) and control the height of the gradient (multiply):

  • $\begingroup$ Hi Markus, Thank you for this detailed and easy-to-follow answer! This comes in very handy, however I wanted to create the gradient within the tile, so for example along the y axis, instead of creating the gradient over time. Sorry if I explained that a bit vaguely $\endgroup$
    – tskn
    Sep 21, 2023 at 22:12
  • $\begingroup$ @tskn see edit. $\endgroup$ Sep 22, 2023 at 7:47
  • 1
    $\begingroup$ Hi Markus, Perfect, thanks so much for this! Having a hard time grasping the math nodes so I really appreciate this. have a great day $\endgroup$
    – tskn
    Sep 22, 2023 at 8:11
  • $\begingroup$ @tskn think of it this way: the texture takes Vector as input, which by default (when you don't connect anything) is Generated. Then based on $xy$ (you can ignore $z$ in this case and treat it like 2D texture) it tells you what is the height of the mathematical surface (like if you asked google maps what's the height above sea level at this longitude and this latitude). "Greater Than" displays all peaks (above $0.75$ height) as white color. "Add" moves the surface up. Adding $y$ makes the upper part higher (so much so that at some point everything is the "peak") $\endgroup$ Sep 22, 2023 at 9:53

You must log in to answer this question.

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