1
$\begingroup$

I am creating a node group that I would like to be able to make 6- 8 individual colors available for the material. While it would be ideal, I am aware that color ramps cannot be used from outside of a node group. As an alternative, I have tried chaining mixRGB nodes with the intent of separating the colors individualy. The problem I am having is that chaining mix rgb nodes seems to be unpredictable at times as to how exactly colors will mix/ separate.

The following image is to better illustrate my difficulty. The material settings in node shown are for the object displayed. The resulting mix is nothing like what is selected from the group. It seems that colors are ignored rather than combined or separated, and I don't know how to control this. I ultimately want to control a color per node in the 'math' node group within the material, which I think I can work out once I get this part sorted.

enter image description here

I have seen and tried working with this answer, but wasn't able to work with it when combining multiples of these groups together. I am also having a similar problem with the proposed answer. (Separating colors predictably)

Thus far, I have the material somewhat working but the colors blend somewhat unpredictably and seem to be a bit unreliable in how the material is affected. I haven't been able to find a good way to approach the problem. Below are the current node setups for the approaches I have been using.

This is my current node setup for my approach using mix rgb nodes:

enter image description here

What I would like to achieve, I have come close to using color ramps, but the problem there is that in order to make a change to color, I have to open the group, make the changes, and then continue.

This is the setup I used with color ramps: enter image description here

This is the 'Math" node group within the material:

enter image description here

The general look I am after is as follows, the shader ball on the left is assigned the mix rgb setup, and the one on the right,which would be closer to the look I'd like the material to have is the color ramp setup:

enter image description here

Is what I am trying to do possible? If so, what is the correct way of doing this?

Here is the .blend file for anyone who would like to take a closer look and not copy a node setup from a screen shot:

$\endgroup$

1 Answer 1

1
$\begingroup$

Here is a way that can help :

enter image description here

I dont consider here the way you are using this kind of ramp, but I have just focused on a way to obtain the ramp. So I did not wanted here to reproduce the way you are using the shader (only the ramp).

This "pseudoRamp" node group is a thread of several "rampMix" nodes groups (this node group can be reused to have more or less colors as inputs) :

enter image description here

And the role of each of them is to give a color between two (the previous color and the tested color) depending if the value is in between the values margins.

Here is the "rampMix" :

enter image description here

And the "rampMix" itself uses a "between" node group :

enter image description here

This last "between" node group needs to handle the limits of "lesser than", as it is strict ("<" and not "<="). So we cannot use "lesser than" with a "greater than" or we will miss the limit value.

Here is the blend file

Note : this is not perfect at the limit, as you cannot downgrade the amount of colors (the last will stay last, but previous ones can overlap each other). So a little enhancement is needed for that.

Complement for the criss crossed aspect

The nodes described above can be mixed in order to make crossed color lines :

The first nodes on the left are here to modulate the amount of strips and are based only on the X, Y values in order to cross these axis only. enter image description here

$\endgroup$
5
  • $\begingroup$ Thanks @lemon this is close, but I can't get it to separate color predictably this way either. $\endgroup$
    – Timaroberts
    Jul 5, 2016 at 6:13
  • $\begingroup$ @Timaroberts I have difficulties to understand what you are looking for... could you add some "hand drawings" pictures to help ? $\endgroup$
    – lemon
    Jul 5, 2016 at 6:41
  • $\begingroup$ this is not what you want ? i.gyazo.com/57e9631ef53f65f3c377b2c92ea26fea.png $\endgroup$
    – lemon
    Jul 5, 2016 at 6:49
  • $\begingroup$ Hi @lemon, the look was 'criss crossed' if you will.It's subtle, but you can see it above. I will try to edit again to be more clear about the color separation. Currently, I can't control where what color may go where on the material. That is the biggest problem, not knowing how they will separate. $\endgroup$
    – Timaroberts
    Jul 5, 2016 at 6:55
  • $\begingroup$ Hi @Timaroberts, like this ? i.gyazo.com/d71f206e328f3638a1baa1b896e9e1a8.png $\endgroup$
    – lemon
    Jul 5, 2016 at 7:37

You must log in to answer this question.

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