0
$\begingroup$

I am trying to make a brain coral.

Currently I'm using a displacement modifier with an actual brain texture, which looks quite good. However, I cannot figure out how to get the material to work right. My coral is based off of this image:

Brain Coral

I want to make a gradient material that makes the deeper groves orange, and the extruded parts bright yellow, based on the distance from the center of the mesh. All of the online methods that I've tried so far have resulted in a gradient from one side of the mesh to the other.

Is there any way to do what I'm attempting?

I am currently using Blender 2.8 with EEVEE.

$\endgroup$
  • $\begingroup$ Texture coordinate node has an 'object' output. This output gives coordinates from the object origin. With that can calculate the distance from the center. $\endgroup$ – lemon Oct 15 '19 at 7:20
  • $\begingroup$ @lemon I tried using the object output in every node combination I could think of, but the color is still applied based on global coordinates, causing the object to be yellow around the middle and orange at the top and bottom. I would like the color to be based on normal distance if that's possible. $\endgroup$ – ScienceKeanu Oct 15 '19 at 15:49
3
$\begingroup$

Considering your mesh vertices are approximately centered around the object origin (if not, this will not work as expected with this solution), you can use this kind of setting:

From the object output of texture coordinate (which gives x,y,z values relative to the origin).

Calculate the distance to the center (dot product then square root).

Subtract some value which may correspond to the inner orange part distance to the origin.

Input this result into a colorramp tuned to mix yellow/orange appropriately.

enter image description here

$\endgroup$
2
$\begingroup$

Lemon's answer works well and is what I was trying to achieve, but another simple answer has also occurred to me for my particular situation. Since I'm using a displacement texture to control the shape of my object, I can simply use that texture as a factor for the color ramp. I might still use the texture coordinate based method though as it will allow me add detail to the mesh without a displacement map.

enter image description here

$\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.