I am trying to make a procedural texture for donut, I want the white dots ( sugar ) to be only on top instead of all over the donut, How can I do ?

enter image description here

  • 1
    $\begingroup$ weight paint maybe? $\endgroup$ – eromod Jul 5 '16 at 4:08

To get a mask of the top of the model, you can use the Normal output of the Texture Coordinate node. This gives a map of colors -1 to 1 along the X Y and Z axis. You can use a separate XYZ node to use only the Z axis, which can be used as a mask of the top of the model.

Node Setup

This gives a nice result


I used the Subtract node to control how high the mask was on the donut. Because the output from separate XYZ is a black and white image, you can manipulate it easily.


Then I added the Sugar texture onto black using the Z Normal as a mask, giving a black and white texture with the white dots acting as sugar.

| improve this answer | |

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.