Author Topic: Gradient displacement ?  (Read 1698 times)

Hi everyone,

I come to you because I'm trying to apply a cactus shader tutorial (very nice : https://www.youtube.com/watch?v=Nmw4t10Fj9s&ab_channel=JoakimStigsson ) and i wanted to add an effect of gradient displacement for my holes, without success..  :(







Does any of you know how i could do to obtain this king of placement :




Thanks !  :)

I've been playing with this a bit, and it seems trickier than I expected. My approach has been to feed the gradient into a Levels node, since your problem is that each dot is moving up just a bit more than the last, linearly, which makes it just look squashed. The levels, I thought, should give us enough control to give it the right sort of curve.
Well, the problem that that brings is that the tiles tend to wrap up over the top and get in a big mess at the bottom again. The best I've come up with so far is to have the size Y set to 0.5, displacement set to 0.5 pointing down, with the levels making the gradient just a tiny bit darker. It fills the bottom half of the image only, so I have to stretch the result with Transform.
Not completely elegant, since stretching is involved, but it might be at least a starting point for you.

Thanks Cory, it's a good solution for the moment  :)

But with this solution we only can have a reel gradient displacement at the top, once the gradient is getting white, the rest of the tile will be equidistant. Finaly its ok for my cactus, i didn't wanted to get more space at the bottom of my mesh, i just really wanted less spaces betwen the top holes.

The thing I don't understand is why the displacement doesn't react like it should with the gradient, like, gradually ?  ???
Like when I assign it to the scale vector map? To have a real contrast between black side with close holes and white side with spaced holes?  ???

Quote
The thing I don't understand is why the displacement doesn't react like it should with the gradient, like, gradually ?
It is offsetting them gradually: the white part of the gradient is offsetting a dot by the full displacement value. Something 50% white is offset 50%. On a linear gradient the 50% white value will be at 50% of the height of the image. So the distances between the dots stays even.

In your example you can see the lowest and highest dots have barely moved and the dots towards the center have moved the most. I can't test it right now, but I expect a gradient going from black to white, back to black (gradient linear 2 I think) will give you the distribution in your example. Maybe also try playing around with a curves node after the gradient.