Random colour or map in a shader.
Mehod i use is simple:
Input map (VrayColor, Noise, etc)
Color modifier (Color Correct)
Random gray generator. (VrayMultiSubTex or BerconGradient)
Random Distributor. (Gradient Ramp, Mix)
Probability Modifier.( Output)
What we do... Lets take a look at the diffuse branch.
I have input (VrayColor) then i'm modifying it (Color Correct) so it has random feel, then it connects to the Random Distributor (Gradient ramp).
Lets Look at the Random Gray Generator (VrayMultiSubTex or BerconGradient), Probability Modifier(Output) and the Distributor(Gradient Ramp).
I use two options: VrayMultiSubTex and BerconGradient.VrayMultiSubTex : The way i use this is keeping the default preloaded 20 gray tones and from the drop down list i chose something from the random stuff most of the time Node Handle or RenderID (they are kept same at every render so it doesn't randomised on every render). This will generate random gray color (from the 20 options we have) different for every object.
BerconGradient: From Type dropdown list i chose Random and its done. Is the better solution as it produces all 255 shades of gray, you can randomise by obj, Mat ID, BerconTile and etc. But has a huge drawback BerconMaps must be installed and sometimes they crash from version to version.
We can use Multitexture as Gray Generator but this is not mainstream like above methods because of lack of pure black and white. (it can be achieved by using 50% gray and push up the random gamma by ~1.35)
Next we have Probability Modifier(Output) and Random Distributor (Gradient Ramp)Probability Modifier: It's Simple Output map where we correct the gray tones produced by the Gray Generator so we shift to more darker, more ligher, add contrast or remove it.
The Random distributor is a Gradient Ramp with selected from Gradient type drop dawn list Mapped so it takes the gray input map from the Gray Generator compares it against the gray spectrum and then places the Blend/mix between the gradient nodes. For two option randomising you can use Mix Map.
Another schematics to show is the short 2 option version, most commonly used by me:
We define darkest and lightest colour and put at random different shades. We use mix as Distributor because we don't need any more inputs but we can use Gradient Ramp if we like to.
Another case is sending different maps and blend between them at random objects:
Experiment try and research. Download the Material Collection to check how it works.
PS: You can skip the Probability Modifier and you can combine in one node the Gray Generator and the Distributor with BerconGradient but as i said it crashes very often so it's not encouraged. (crashed when tried to make the example)
Best regards
Rostislav M.
Version: 1.0