In this tutorial, we will use the versatile utility shader to generate random colors for the sprinkles on a donut. We will then use a variety of color shaders to further adjust the colors of the sprinkles.
Standard Surface
- Start off by creating a standard_surface shader and rename the shader 'Sprinkles'. Assign it to the sprinkles geometry.
Utility Shader - Color Mode
- Create a utility shader and connect it to the base_color parameter of a standard_surface shader. We will use the Object Mode of the utility shader to add random colors to the sprinkles. This mode uses the name of the shapes to compute the color.
- We don't want any shading from the utility shader as we are already using the standard_surface, so change the Shade Mode to flat. 'Flat' renders the model as a pure, solid, flatly lit and shaded color.
Utility Map connected to Base Color of Standard Surface shader
Random - Seed
We can use the random shader to create variations of color for our sprinkles. Random's seed parameter animated (utility shader set to object mode)
Composite
We can also use the composite shader to mix in another color using a blend mode. Color of sprinkles tinted with an orange color using the multiply operation of the composite shader
Change B color to orange and Operation to 'multiply'
Color Convert
Another way to change the colors of the sprinkles is to use a color_convert shader. Color space converted to xyY
Color Correct
Once you are happy with the general colors of the sprinkles, you can use a color_correct shader to further fine-tune their appearance. Fine-tune the colors using a color_correct shader
That concludes this tutorial. Have a go at experimenting with some of the other color correct shaders to create some different variations of color.