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$
5
  • $\begingroup$ Give different material to appropriate faces.If faces along the strip are to big, add some edgeloops. $\endgroup$
    – Mzidare
    Commented Oct 19, 2016 at 12:17
  • $\begingroup$ If you want to use texture, then follow this nice tutorial $\endgroup$
    – Mzidare
    Commented Oct 19, 2016 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
    Commented Oct 19, 2016 at 12:58
  • 1
    $\begingroup$ But I don't want a texture, I want a color ramp. Not possible? $\endgroup$
    – zephirus
    Commented Oct 19, 2016 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
    Commented Oct 19, 2016 at 13:23

2 Answers 2

15
$\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$
2
  • $\begingroup$ Thanks David, that is exactly what I was looking for. What I was missing was the "Separate XYZ"! $\endgroup$
    – zephirus
    Commented Oct 19, 2016 at 13:33
  • $\begingroup$ You can change the colour ramp interpolation from linear to constant to get a sharp edge between colours. $\endgroup$
    – sambler
    Commented Oct 19, 2016 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$

You must log in to answer this question.

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