Gradient transition between materials

I have one object with two assigned materials. I would like to create a gradient transition between the materials, from white to black material. I want to do this without uv mapping, Can I somehow use the data from the edge loop to create the gradient?

Not really unfortunately, materials are an either-or thing in blender.
To create a gradient between two shaders you need to make everything a single material with a “mix shader” node mixing between said shaders. How you drive the mix input is up to you, if you don’t want to use UVs you might be able to get away with position data or vertex painting, depending on your model and the result you want.

To clarify the inner material is white color, and the outer rim material is a mix shader between black and white color, where the gradient ramp would create the transition.

1 Like

The black part would be made by mixing the shaders and creating the transition.

In your slot 1 material, you need a direction to drive the gradient… that can be a math function or a coordinate system…

I would just simply create a new UV map, unwrap the faces in a rectangular way, and use either the U or V axis to feed into the gradient.

You could also use the vector distance to the center and use the MapRange node to map the distance to the segment of your transition.

1 Like

I have to do this for a complex object so I can’t use UVs.

Can you please show me how it can be done with map range? I have no idea how to go about it.

You could use vertex colour attribute as the factor, no UV’s needed?

Hope that helps

1 Like

What did you do exactly? Add a color attribute only for the vertices? Can you share your file?

If it’s a complex object, than most probably the distance trick won’t work (it only works in linear or spherical situations).

You could also try what @AlphaChannel suggested, which is also a solution.

1 Like

Like @AlphaChannel I thought at vertex paint to drive the transition

1 Like

Can you please share the blend file.

Really?

I selected the verts and set them in vertex paint mode.

Then I setup the material like the screenshot.

1 Like

If you want I can share the file but actually you’ll find the result and not what I do.
I mean that, as wrote by @AlphaChannel , I’ve painted the vertices, black for the external vertices, white for the inner part of the top.
The two meshes have just a slightly different paint.

I think you could try by yourself. It’s quite easy.
I repeat, I can share the file but you’ll not learn how to paint vertices.

2 Likes

if manual vertex painting is too tedious, you could do it procedurally.

matblur.blend (727.9 KB)

note that you might need denser geometry for a less jagged gradient because vertex colors.

2 Likes

Thanks for all the replies. This would have been easily solved with a distance map like in Corona, Vray, Fstorm. It has become a standard.