9
$\begingroup$

I have a torus and I need the material to use a color ramp so that all the surface has one color (red) except for a strip along the longest edge (yellow). Something like this:

enter image description here enter image description here

I tried unrap in every way with no good results. Also, tried to add seams and nothing. What is the way to do this?

Thanks!

$\endgroup$
  • $\begingroup$ Give different material to appropriate faces.If faces along the strip are to big, add some edgeloops. $\endgroup$ – Mzidare Oct 19 '16 at 12:17
  • $\begingroup$ If you want to use texture, then follow this nice tutorial $\endgroup$ – Mzidare Oct 19 '16 at 12:50
  • $\begingroup$ In edit mode U -> Project from view (bounds) from ortho side view (that you have in top picture) and then add a texture colored red at the top and bottom and yellow in the middle (like spanish flag) and have it use the UVs . $\endgroup$ – kheetor Oct 19 '16 at 12:58
  • 1
    $\begingroup$ But I don't want a texture, I want a color ramp. Not possible? $\endgroup$ – zephirus Oct 19 '16 at 13:16
  • $\begingroup$ Yes possible, If you want to use internal you can use "blend" type which is a generated gradient. You could even use it with generated coords if you don't need the UV control. And for Cycles there is already an answer. $\endgroup$ – kheetor Oct 19 '16 at 13:23
13
$\begingroup$

This type of material is super easy to do in cycles. First break down what you want to do.

  1. You want to have a gradient (three color stops).
  2. You want the gradient running along the Z axis.

With that as our objective, we don't even need to touch any UV mapping.

Start by getting a gradient running in the direction you want (Z axis).
There are several ways to do this, but I like to simply split the generated texture coordinates, and use the Z component. That is the gradient, no other nodes needed.

All that is left to do is run that (think of it as the direction data) in to a color ramp node to colorize it the way you want.

You can do all that with a Separate XYZ node plugged in to the Generated socket of a Texture Coordinate node. Then take the Z output of the Separate XYZ node and plug it in to the color ramp. (Like in the image below)
cycles material nodes

$\endgroup$
  • $\begingroup$ Thanks David, that is exactly what I was looking for. What I was missing was the "Separate XYZ"! $\endgroup$ – zephirus Oct 19 '16 at 13:33
  • $\begingroup$ You can change the colour ramp interpolation from linear to constant to get a sharp edge between colours. $\endgroup$ – sambler Oct 19 '16 at 15:44
4
$\begingroup$

Here is the setup for internal renderer:

enter image description here

UVs were projected from side view. You can also use Generated coordinates by changing the Y (middle dropdown below Projection options) mapping to Z as shown.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.