6
$\begingroup$

As seen below, I have a material with a wave texture applied over it. However, I'd like to have the wave texture only appear at the top of the mesh to represent grill marks, like grill marks found at the top of a filet mignon. Is it possible to subtract part of the wave texture so it only appears at the top of the mesh? Thanks!

enter image description here

$\endgroup$
2
  • $\begingroup$ Hello, do you want the limit to be clear (in that case, Chris' answer si good) or smooth (in that case you need to create a mask between top and side faces, procedurally or with an image)? $\endgroup$
    – moonboots
    Aug 7 at 6:46
  • $\begingroup$ @moonboots Hi! I'm looking for a smooth transition please. If you have a link or an answer on how to do the smooth mask method, please feel free to share it. :) $\endgroup$ Aug 7 at 6:50
7
$\begingroup$

You can create 2 different textures (here the wave texture and the pure brown texture) and mix them with a vertical black and white gradient as mask (use the Texture Coordinate Generated output, plug it into a Converter > Separate XYZ node that you plug into the factor of the Mix Shader):

enter image description here

$\endgroup$
3
  • $\begingroup$ Very nice! 👍🏻👍🏻👍🏻 $\endgroup$
    – Chris
    Aug 7 at 7:05
  • $\begingroup$ thanks, the other solutions would have been to use Vertex Paint as mask (but you need a bit of topology) or an Image Texture as mask $\endgroup$
    – moonboots
    Aug 7 at 7:08
  • $\begingroup$ Thanks so much, that worked perfectly! Thanks to Chris too for your recommendation. :) $\endgroup$ Aug 7 at 7:25
8
$\begingroup$

As the normal of your surface approaches alignment with the Z axis, the absolute of its dot-product with (0,0,1) approaches 1, (from 0). So you can map a range of that to 0->1 to create a mask between stripes and no-stripes:

enter image description here

If you use the Normal, it has a nice side-effect of putting a tiny bit of char in any nobbles there may be in the sides of your patty..

enter image description here

The Normal output of Texture Coordinate is in Object space, so you can flip your burger OK.

$\endgroup$
7
  • 4
    $\begingroup$ damn Robin, does this have to be!?!?!? NOW i am hungry!!!!😱😱 $\endgroup$
    – Chris
    Aug 7 at 7:58
  • 2
    $\begingroup$ I hope it's vegan $\endgroup$
    – moonboots
    Aug 7 at 8:04
  • 1
    $\begingroup$ @moonboots It does look disappointingly Vegan.. :( .. It would take a bit of time to tweak little pools of fat, dripping juices, pinkness in the middle... $\endgroup$ Aug 7 at 8:10
  • 1
    $\begingroup$ Awesome solution @RobinBetts! That works great too! Really nice burger, btw. :) $\endgroup$ Aug 7 at 11:51
  • 3
    $\begingroup$ @Chris don't eat vertices!! $\endgroup$
    – moonboots
    Aug 7 at 12:50

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.