Assigning specific colours to a MASH network

Image by Matt Oxley. Autodesk Maya 2018, V-Ray 3.6, Adobe After Effects CC2018.

Q: Random colours are great but how can I use the Color node to assign specific colours to objects in a MASH network?

A: You can use the UV Tile Settings on the Color node. This is similar to how the UDIMs feature works but instead of texture maps, ramps can be used to assign specific colours to UV tiles. The beauty of this set up is that you can do it all in one shader meaning common attributes like reflectivity only need to be adjusted in one place.

  1. Create a Cube and assign a material to it.
  2. With that Cube selected, create a MASH network with a Point Count of 10. (make sure you select the mesh option on creation)
  3. Add a Color node
  4. Under UV Tile Settings, set UV Mode to Unique, and Tile Count to 5
  5. Add a Ramp to the Diffuse channel of your material.
  6. Set Type to U Ramp and Interpolation to None
  7. Add a new color component to your ramp and set Selected Position to 0.1 (repeat in increments of 0.1)
  8. On the place2dTexture node set Repeat UV to 0.1, 1.

In the render above we've then taken this idea a bit further and added file textures to some of the ramp colour components. Have a play with the settings under UV Tile Settings on the Color node to control how your colours are being assigned. If you open the UV Editor with the Repro selected you'll see the UV tiles MASH is generating.

Tip - if you need more than 10 colours then make your first ramp a V Ramp, set the Repeat UV attribute of the place2dTexture node to 1, 0.5, create color components at Selected Positions of 0 and 0.5 and then add U Ramps to each of those (and then follow the above). That will give you 20 (2 x 10) colours.

Download an example file here (requires Maya 2018)