Add Random Colors To Clones using Redshift in Cinema 4D

In this post, I’ll go over how to add random colors to your mograph clones in Cinema 4D using Redshift’s Color User Data node.

In the scene pictured below, I have some tube objects that have been randomly scaled and aligned along some wavy splines (you can download the project file at the end of the post if you want to explore how the scene was built). Each group of aligned cylinders has been assigned a single Redshift material. But as you can see from the render of the scene at the top of the post, the cloned tube objects are a range of random colors. We can accomplish this by using Color User Data in Redshift.

Color User Data

In Redshift, users can access and display the color information of clones by using the Color User Data node in a material. Let’s see how we can use it to give each clone in a Mograph Cloner a random color.

First, double-click on the material you are using on your clones in the Material Manager to open the material’s node graph in the editor. Then search for, select, and drag the Color User Data node into the material’s node graph. In the Color User Data node, you will need to select the attribute of the object you want to display in the “Attribute Name” Presets button. Select the button and choose Mograph > Color and you will see the attribute name “RSMGColor” appear in the menu field. To use the Color User Data to change the color of the clones in the scene, connect the output of the Color User Data node to the Base Color port of the Standard Material node.

Add Random Effector

Next, with your cloner selected add a Random Mograph Effector to the scene by choosing Mograph > Effector > Random from the top menu. You might see the clones change color in the Viewport once you add the effector, but we aren’t there yet. We’ll need to add a Random Field to the effector.

Add Field

In the Random Effector’s Fields tab, Add a Random Field using the drop-down menu. Make sure you click the three interlocking circles icon to the left of the Random Field’s blending modes so that it shows the red, green, and blue circles instead of being greyed out.

Effector > Fields Color

You will also have to make sure the Effector is using the Random Field’s values to change the color of the clones. To do this, in the Random Effector’s Parameter tab, select ‘Fields Color’ from the Color Mode dropdown menu. Once you do this, if you open your Redshift RenderView and start a preview render you will see that your clones are different shades of grey with some black and white clones. To add other colors, we will use a ramp in the Node Editor.

Add Ramp

In the Node Editor, search for, select, and drag a Color Ramp node into your material’s node graph. Connect the output of the Color User Data node to the Alt Input of the Ramp node. Then connect the output of the Ramp node to the Base Color of the Standard Material node. Again, you won’t see much change by default because the ramp goes from black to white by default. To add your own custom colors, you can delete the black and white knots and add your own with whichever colors you choose. You can also choose “Load Preset” and pick from a few different color ramps that come with Cinema 4D.

Change Knot Interpolation

One thing to keep in mind is the interpolation between the knots of the ramp. Setting the knots to Step interpolation will make it so only the colors of the knots in your ramp will be used in the material. If the knots are set to Linear, Smooth, or one of the other options, the clones will display the range of colors between the knots of the ramp along with the color of the knots themselves.

Download the Project File

If you want to explore how the scene was built or experiment with the render, download the project file and materials. You should be able to just open it up and hit render.

In my next post, I’m going to discuss my workflow for volume modeling and how to use procedural noise to create some really interesting geometry.

Next
Next

Creating Depth of Field in Cinema 4D and Redshift