I am wondering how to make a color gradient following the changes of curvature of a surface. The trick is, I would like the color gradient to only follow the changes of curvature along z, like in the image I post here. enter image description here

Thank you for your help!



You can use the normal output from the "Texture Coordinate" node, then extract the z value. A value of 0 means the normal is orthogonal to the vertical axis, a value of 1 means the face is horizontal, facing up, and a value of -1 means the face is horizontal, facing down.

Shade smooth, shade flat, and wireframe in [-1;1] :

enter image description here

Shade smooth, shade flat, and wireframe in absolute [0;1] mode :

enter image description here

As pointed out in the comments by @Robin Betts, this will give you the normal in local space. It means if you rotate your object, but don't apply the transform, the color of each face will stay the same. If you want your shading to be applied in world space, you should use the normal output from the "Geometry" node.

Illustration :

enter image description here

Top row : World space, using the "Geometry" node

Bottom row : Object space, using the "Texture coordinate" node.

Rotation is not applied in both rows.

enter image description here

  • 1
    $\begingroup$ This is in Object Space... maybe @Gael wants it in World Space (Geometry>Normal)? Prob. no difference here... $\endgroup$ May 27 '20 at 9:19
  • $\begingroup$ @RobinBetts Alright ! Thanks, that slipped my mind :) $\endgroup$
    – Gorgious
    May 27 '20 at 9:41
  • $\begingroup$ That is wonderful, exactly what I was looking for, thank you so much! :) $\endgroup$
    – Gael
    May 27 '20 at 23:06

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.