10
$\begingroup$

Is there a convenient way to make a rainbow material that varies smoothly along a torus? In the image below, I made a new emission material for each of the 32 segments along the major axis, changing the HSV hue by 1/32 each time. Clearly, you can still see bands of color; plus, it's labor intensive to make all of these materials, and challenging to edit afterwards.

Torus with color bands

Ultimately, I'd like to have the material's color spin around the object.

$\endgroup$
0

3 Answers 3

14
$\begingroup$

You can do it this way: Texture Coordinate (Object output) > Mapping > Gradient Texture (Radial mode) > ColorRamp (that begins and ends with the same color) > Emission > Material Output. To make the color spin, use the Mapping Z Rotation value:

enter image description here

$\endgroup$
15
$\begingroup$

Just to add to Moonboot's nice answer.
ColorRamp can actually create the whole HSV spectrum for you :).

  1. Set both sliders to Red
  2. Set ColorRamp to HSV > Far
  3. Done

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ I knew about clockwise, but never noticed the "Far" with red2red awesome :) $\endgroup$
    – vklidu
    Commented Nov 7, 2020 at 22:00
  • 1
    $\begingroup$ Yeah, I've learned that from Chris Prenn some time ago. Don't think I've ever used it in an actual project though :). $\endgroup$ Commented Nov 7, 2020 at 22:05
  • 1
    $\begingroup$ I just wanted to use it in 2.79 and It looked like its not working, than I realised second Red has to be a slightly different color from 1/0/0 like 1/0/0.001 So thanks God for 2.9x polishing :) $\endgroup$
    – vklidu
    Commented Nov 10, 2020 at 14:40
  • $\begingroup$ @vklidu Oh that's a nice catch :). $\endgroup$ Commented Nov 10, 2020 at 16:02
6
$\begingroup$

Another possibility for the lazies.

Add a Combine HSV node, plug in the hue and set the saturation and value to 1.

enter image description here

enter image description here

$\endgroup$
2
  • 2
    $\begingroup$ Try replacing the Hue Saturation Value node (which changes an input color by those values) with a Combine HSV node. This lets you specify the Hue, Saturation and Value directly - just set a non-zero Saturation and Value and then use the gradient to drive the Hue. $\endgroup$ Commented Nov 4, 2020 at 12:12
  • 2
    $\begingroup$ @RichSedman Thanks for the tip :) $\endgroup$
    – Gorgious
    Commented Nov 4, 2020 at 13:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .