Page 1 of 2
Random color node - how to limit
Posted: Mon Aug 04, 2014 8:49 am
by portnicki
Hey all,
this is probably smth real easy but I'm stuck at it.
I have 50 instances of an object (working in modo). I want to randomly color them all either pink or green.
I do not want any other colors that are in between. I want Octane to choose a solid color from a two-item group (pink and green) and put it on an instance.
We all know what random color node does. I guess hooking up a some kind of node to the "Amount" pin in the Octane mix texture would help me ... but which one sould it be?
It should choose 0 or 1 value fromy my set of colors, not all the values in between.
Thanks!
Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 10:08 am
by rappet
Good quest. I like to know how to do that too.
But if you are in a hurry and working with csv file,
In the meanwhile you could split the csv in two csv files
(you can do that with excel and randomize the order before splitting).
Greetz,
Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 10:16 am
by portnicki
yep,
for the time being I've just rendered two passes - with green and pink instances, and simply masked some of them off in Photoshop.
But if this were strands of grass or smth like that (I mean a lot of instances, very close to each other and mixing in strong DOF areas) this work-around wouldn't work

Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 4:10 pm
by riggles
Yeah, I was wondering how to go about doing this, too, except in the MODO plugin. Seems Octane will only blend between two color values, not select one of the other. It's a bummer because then using texture maps with the random color node would work properly, too.
Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 4:34 pm
by Phantom107
Would be awesome if I could tie a color to each seperate instance somehow in the CSV files...
Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 5:39 pm
by glimpse
Phantom107 wrote:Would be awesome if I could tie a color to each seperate instance somehow in the CSV files...
why not to have 3,4,5..etc.. set of instances (with slightly different colors)? just an idea..
Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 5:50 pm
by Phantom107
glimpse wrote:Phantom107 wrote:Would be awesome if I could tie a color to each seperate instance somehow in the CSV files...
why not to have 3,4,5..etc.. set of instances (with slightly different colors)? just an idea..
That's possible in 1.5.

(I don't mean to hijack the topic)
I think Octane could improve a lot with more texture generators overall. (Based on randomness, distance from the camera, etc)
Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 8:55 pm
by portnicki
glimpse wrote:Phantom107 wrote:Would be awesome if I could tie a color to each seperate instance somehow in the CSV files...
why not to have 3,4,5..etc.. set of instances (with slightly different colors)? just an idea..
yes, I thought of that after I rendered the passes. If I had a more complicated scene I think that would be a best workaround.
cheers
Re: Random color node - how to limit
Posted: Mon Aug 04, 2014 9:56 pm
by smicha
portnicki wrote:Hey all,
this is probably smth real easy but I'm stuck at it.
I have 50 instances of an object (working in modo). I want to randomly color them all either pink or green.
I do not want any other colors that are in between. I want Octane to choose a solid color from a two-item group (pink and green) and put it on an instance.
We all know what random color node does. I guess hooking up a some kind of node to the "Amount" pin in the Octane mix texture would help me ... but which one sould it be?
It should choose 0 or 1 value fromy my set of colors, not all the values in between.
Thanks!
YOUR PROBLEM IS SOLVED!
Look here
http://render.otoy.com/forum/viewtopic.php?f=73&t=41388
I just come out with an idea and Marcus coded it. Just use colored texture instead of color.
PS. Jak coś to pisz

Pozdro z wawy.
Re: Random color node - how to limit
Posted: Tue Aug 05, 2014 2:10 am
by abstrax
That would be the way I would do it:
Until we have the ability to switch off interpolation in the gradient texture you can achieve a similar result by adding two gradient control points with the same position:
This is how the gradient node looks like:
Packed everything together into a node graph you get a nice and easy to use interface:
I hope that helps.
Marcus