6
$\begingroup$

I'm trying to add rust over the top of a texture I've painted for my mesh. I've got the base texture here: enter image description here

And the rust material loop here:enter image description here

And basically I'm trying to just get the rust on top of the yellow and black texture, with the yellow black texture replacing all the non-rusted metal parts in the rust material. I've tried using a mix shader but obviously that just blended the two together and didn't give me what I was looking for. I've also managed to achieve pretty much the exact inverse of what I want with the difference blend mode, like this:enter image description here

But I can't figure out how to make the metal yellow and keep the rust.

This is what my node graph looks like:enter image description here

EDIT: Here's the result I got, plus the node graph: enter image description here

enter image description here

$\endgroup$
3
  • $\begingroup$ It's hard to tell without seeing your node graph, but presumably, you could place an Invert node on whatever you're using as the Mix Factor for the 2 images. $\endgroup$ Jul 21 at 5:54
  • $\begingroup$ Yeah, I did try that but it just inverted the colors, not where the actual textures were being placed. My bad BTW, I'll add my node graph to the post. $\endgroup$
    – MVP Teku
    Jul 21 at 5:57
  • $\begingroup$ +1 for a well-composed question with all the necessary details! $\endgroup$ Jul 21 at 14:34
5
$\begingroup$

What you need is a Mask to get the 2 images separated cleanly. You can obtain one rather easily from your Noise Texture by either using the Fac output Connected to a ColorRamp, or convert your rust "color" back to B&W and do the same thing (pictured below - using the colors preserves the same cutoffs you had before, but may not be necessary as I had to further adjust with another ColorRamp anyways). Regardless, set your MixRGB node back to "Mix" (from "Difference") and connect the "mask" as a Mix Factor. If you want even sharper definition on the cutoff areas, consider switching the mask ColorRamp to "Constant". You can also see I had to invert the sliders on the mask ColorRamp to make the mix correct - another way to accomplish the same thing is to switch the positions of the color inputs to the MixRGB Node). Lastly, the RGB to BW node is not necessary - I just put it to highlight that the mask must be converted back to B&W:

Mask

Here's another example showing some correction (no RGB to BW, and the color inputs are connected "correctly"). If you want the most detail in your texture mix, you will have to incorporate your Mask into your Roughness and Bump maps as well (shown below).

DetailMix

However, this method can get complicated if you have a lot of maps to mix. An easier way is to keep each material as part of its own separate shader, and then mix the two using a Mix Shader and the same Mix Factor.

MixShader

$\endgroup$
4
  • $\begingroup$ Ok I tried that and it's painting the textures where I want them now but the rust itself has become mostly black and my node graph seems to look identical to yours so I'm not sure where I've gone wrong. I'll add photos to the original post for reference. $\endgroup$
    – MVP Teku
    Jul 21 at 6:23
  • $\begingroup$ Sorry, I'm trying to hastily recreate your setup, but they are not the same - some things may be different in my graph than in yours. The basic idea is that you need a black and white (or greyscale) mask to define which image goes where - one texture gets mapped to the white areas and the other is mapped to the black. Any grey areas will show a blend of the two, depending on the "darkness" of the grey. I used a ColorRamp to better define clear "white" and "black" areas from your noise texture and use that as a mix factor. I added a simpler example to my answer. $\endgroup$ Jul 21 at 6:32
  • $\begingroup$ With regards to the black areas - I think you either need to invert the slider positions on the ColorRamp, or switch the Color Inputs on the MixRGB (I could be wrong, though) $\endgroup$ Jul 21 at 6:35
  • 1
    $\begingroup$ Thanks a lot, that worked. $\endgroup$
    – MVP Teku
    Jul 21 at 7:07
3
$\begingroup$

Here is a try, not perfect on the fringes of the rusty parts though, board1.png is the font, board2.png is the rust:

enter image description here

Actually the best would have been to create 3 images: 1) the font 2) the rust on the whole board 3) a mask to separate the font from the rust.

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