MoGraph Multishader with Random Effector doesn't apply colors Equally Likely


#1

Apparently I don’t quite understand how to use the MoGraph multishader along with the random effector and a cloner. All I’m trying to do is get my cloned objects to have a (relatively) equal amount of each color. Obviously it won’t be perfectly equal because it’s supposed to be random. However, what I don’t understand is this. My cloner has 20 cloned objects. My material with the multishader has only two colors. I’m using a random effector with the color mode set to on affecting my cloner. The multishader is using “Color Brightness” as its mode. The blue texture is listed as texture 1, and the red texture is listed as texture 2.

When varying the random seed several times, here are the counts of each color I’m getting:

It doesn’t take a rocket scientist to see that there’s a clear bias toward blue. But I don’t understand why this is. I have attached my C4D file for reference. Can somebody please help me understand why the colors aren’t being chosen equally likely, and what I need to do to make the choice unbiased?

Note, that I am NOT trying to alternate or have an equal amount of each color. I am just wanting to make the random effector actually apply the various colors in the multishader equally likely so that the number of clones of each color is truly modeled by a Binomial Distribution with parameters p = 1/2 and n = 20.

sample.c4d (273.0 KB)


#2

Try ticking Use Alpha/Strength under Parameter tab of the Random Effector.


#3

That worked, thank you! But can you explain why that works? Although it does fix the problem, I don’t really understand why it fixes the problem.


#4

Another method that would fix the problem for you is in the Random Effector under the Effector tab. Twirl down the options for Min/Max and change Min from default of -100% to 0%. If you do that, there is no longer a need to tick Use Alpha/Strength.

It’s hard to explain the why, but I’ll try based on my understanding (someone correct me if I’m wrong)…
Either of the methods I’ve given you just resolve the math for randomization to be chosen without the bias of negatives being possible. When you have a choice of 2 colors, it means if negative numbers are possible, one color will get chosen more than the other as negatives use the “default” color. Blue was your first color (default) it could choose. In your specific case, all choices from -100 to 0% were blue (your top color, index 0 in Multi Shader) and then from 0 - +100% there was also a 1 in 2 chance they could also be blue meaning you could potentially get many blues as you did. Min/Max is easier to understand why it fixes the problem, but I guess that Use Alpha/Strength probably does the same basic thing mathematically.