Random Colours with Cinema 4D Multishader

In the previous ramble about random colour, Leah asked

I’ve been wondering, is there any way to use effectors to apply a random color from a subset of colors (such as a range or gradient)?

So here is one method of achieving that.  I’ve used the multishader to create a subset of colours.

Multishader

Multishader

Then the random effector to randomise those colours.

Not sure if it is possible from a gradient, but if anyone has an idea for that then please post a comment.

Well Rick Barrett from Maxon came up with the solution here.

For a gradient, just put the MoGraph Color Shader in a Colorizer shader.

Nice and simple too. Thanks Rick.

Result using Multishader

Download the C4D file here


Random Colours with Cinema 4D Multishader

Author: Tim

21 Comments

  1. poolparty
    poolparty On March 3, 2009 at 1:03 AM

    i get a texture error with the multi shader. what’s up with that?

  2. Tim
    Tim On March 3, 2009 at 1:32 AM

    If it’s a new scene, with a new material. Then you apply the Multishader to say, the color channel.

    Do you get a texture error then?

    I just tried with a fresh scene and it was ok for me.

  3. Rick Barrett
    Rick Barrett On March 3, 2009 at 7:45 PM

    For a gradient, just put the MoGraph Color Shader in a Colorizer shader.

  4. si bangsat
    si bangsat On March 5, 2009 at 8:18 AM

    hi, nice blog. Too bad just a little bit topic there.
    i’m very interested with your logo (hypa tv logo). Is that using GI ? how to create a neon box like that? with diferent color? i tried to use GI and light inside the box but the result is not good enough as yours. Can you explain the making of hypa logo as the next topic in this blog?

    Thanks

    bangsat

  5. si bangsat
    si bangsat On March 6, 2009 at 3:24 PM

    Sweet…I love pretty much everything I’ve seen. Wish i could make it..

  6. Leah
    Leah On May 4, 2009 at 3:58 PM

    Awesome! Thanks for the simple and powerful solutions, Tim and Rick.

  7. paul
    paul On June 11, 2009 at 10:59 PM

    Rha ! Thanks God ! Thanks Hypa !

  8. Alex
    Alex On October 19, 2009 at 10:05 PM

    Looks like this technique doesn’t work with lights…
    Any idea how to make that work?

    Thanks
    Alex

  9. […] from aenhancers (awesome site by the way) asked an interesting question regarding the More Randomness post. He was interested to see if the same principle could be applied to […]

  10. obiten
    obiten On January 19, 2010 at 10:27 PM

    Hi Señor Tim,
    I’m trying since this morning to apply this technique (randomness color) to a mograph text object,
    but it seems impossible ! Can’t I apply this randomness to each letter of a mograph text object ?
    Same thing for a gradient, I can’t !
    Do you have any clues ?
    Thanks, Obi10

  11. Heerko Groefsema
    Heerko Groefsema On January 20, 2011 at 3:14 AM

    Very helpful. I had to use the mograph multi shader today, and I forgot how it worked. Luckily there is always you to help out 😀

  12. Matt
    Matt On August 8, 2011 at 10:47 PM

    Hi Tim,

    I have 1 row of a linear cloned cubes with a plain red material. I want the first cube to switch to plain white and then it switches to the next and so on…light runway lights….how do you do this…I playing around with the step effector but its driving me daft!!!! 🙁

    • Tim
      Tim On August 24, 2011 at 3:05 PM

      @Matt I’d use the shader effector with a tiled gradient. Then offset the position of the gradient in the texture tag.

  13. Matt
    Matt On December 21, 2011 at 3:55 AM

    Hi Tim,

    Thanks for the advice, much appreciated. It seems to do the trick, however, I want to feed a series of colors and I want the cubes to only show a fraction of those colors. I have 5 colors : blue, green, yellow, red, orange and only 3 cloned cubes. I want the first cube to start with yellow, the second red, and the third orange and then change to 1-green 2-yellow 3-red, then 1-blue 2-green 3-yellow and so on.

    Shader effector with a tile seems to malfunction because it shows all the colors in the gradient and I want to have two-three times as much colors and be able to make them pass through the cubes.

    Do you know a way this can be done?

    • Tim
      Tim On December 21, 2011 at 1:45 PM

      @Matt I’m not 100% sure I follow your sequence but you should be able to do this with a multishader. If you need to set one group of objects with one series of colours and another group with another series, you could use a mograph selection to restrict certain effectors to certain clones. Maybe a formula effector to affect every third clone? Try this formula – mod(id;3)

  14. Matt
    Matt On December 22, 2011 at 3:40 AM

    Thanks, Tim. You are awesome. I just re-read what I have written and it doesn’t make much sense to me as well. Sorry for that. Here is a simplified situation of the same scenario.

    http://i.minus.com/iXJyD6nwWi7wg.jpg

    Hope this better illustrates the goal. I think it could be done with a multishader, random effector with sorted mode and falloff, but I get strange results. If you know a better way, it would appreciated greatly.

    • Tim
      Tim On December 22, 2011 at 10:05 PM

      @Matt Try this file – http://luxx.tv/1i I used a flat projection with a gradient and then offset the texture tag. Use this texture tag in a shader effector. Not sure it is exactly what you’re after but maybe it will help.

  15. Matt
    Matt On December 23, 2011 at 2:49 AM

    This was super helpful, Tim. Exactly what I was after. Thanks a ton for taking the time to look into this. You rock!

Leave a Reply