6
$\begingroup$

I have a gradient on a cube with a color ramp. In the picture below you can see the color ramp is repeated just once. I would like to find a way how to repeat it 5 or 10 times. I could do this on the color ramp it self of course, but I prefer to it with a node setup.

enter image description here

After repeating the gradient, it should look something like this, a multiple loop of a color ramp.

enter image description here

$\endgroup$
  • $\begingroup$ You could take the modulo of the vector's components and then combine them back $\endgroup$ – someonewithpc Mar 9 '15 at 22:36
  • $\begingroup$ do you mean that no added node is necessary ? $\endgroup$ – elmentor Mar 9 '15 at 22:48
  • $\begingroup$ Separate the Generated vector input into x, y and z, then take the modulo of the x, by using a math node, the combined the x, y and z into a vector, which you can use to map the texture. $\endgroup$ – someonewithpc Mar 9 '15 at 22:57
  • $\begingroup$ could you add a picture , so i can see what you mean ? thanks $\endgroup$ – elmentor Mar 9 '15 at 22:58
  • $\begingroup$ Not now, sorry - it's pretty late already $\endgroup$ – someonewithpc Mar 9 '15 at 22:59
7
$\begingroup$

You can use a Color Ramp node and a Modulo converter node to achieve this result.

Set up your nodes like this:

Gradient Nodes

And this is the result:

Result

What you are doing is you are making the Color Ramp node tell what color, and then you are mapping it using the Mapping node, and repeating it with the Modulo node. This makes it fully editable, you can change the color ramp, and the resulting texture will repeat endlessly.

Editability GIF

$\endgroup$
  • 1
    $\begingroup$ i wanted to try this solution , i clicked shift A , and searched for a modulo node, but that is not in any list . where do i find it ? $\endgroup$ – elmentor Mar 10 '15 at 6:26
  • 3
    $\begingroup$ It's a generic math node. 'Convertor->Math'. Click 'Add' to see a list of operations the node implements. $\endgroup$ – MarcClintDion Mar 10 '15 at 8:40
  • $\begingroup$ Sorry, yes, the Math node can be changed to many different operations, but you have to add the plain default one first. $\endgroup$ – VRM Mar 10 '15 at 11:09
  • 1
    $\begingroup$ before i start figuring this out , let me ask a bit more about this solution , i see you did this easy with a black and white gradient, an just moved the slider a bit , and there you go. but what if this is a more complex gradient color ramp with more than 7 colours for example and perfectly balanced. is it needed to change all these color faders to get your solution working ? i mean i see you sliding just 1 fader,and it does the job , but that is because it is a simple gradient. if i understand it right , then i need to move all the 7 color faders as well to make this solution work? or ? $\endgroup$ – elmentor Mar 10 '15 at 23:27
  • $\begingroup$ in my thinking i thought there would be a separate new node for this matter, such like the mapping node where you can rotate the gradient. $\endgroup$ – elmentor Mar 10 '15 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.