Is there a better way to mask texture inputs?

   1686   2   0
User Avatar
Member
340 posts
Joined: June 2017
Offline
I asked this in the Houdini learning section of the forum, but wanted to see if I am approaching this wrong. I want to drive the normal map by a texture, which is easily done in the Principled Shader. However, adding a mask to this to only affect part of the image and adjust scaling seems complicated. The only way I've been able to figure out how to do it is to create a black and white mask image and connect this to the scaling of the normal via a multiply node to be able to reduce the effect. The effect needs to cross polygons, so doing this with materials and groups will not work. In other programs, this is an easier process (Blender, Modo, etc.). Is there a better way of doing this than this: (the faceplate has the normal texture attached, as I can't figure out how to do it with nodes, only in the principled shader itself. Texture 1 is the mask).
Edited by Island - Jan. 9, 2022 19:25:48

Attachments:
LayerMask.jpg (81.6 KB)

User Avatar
Member
7794 posts
Joined: Sept. 2011
Online
I'm not sure what you are asking exactly. Is there a better way to mask something with a texture than by connecting a texture node?

The Normal map doesn't have to computed by the principled shader. You could use nodes to compute the normal with more control using the normal texture node, with the final normal connecting to the baseN input of the shader.
Edited by jsmack - Jan. 9, 2022 22:31:34

Attachments:
normal_map_mask_network.png (174.9 KB)

User Avatar
Member
340 posts
Joined: June 2017
Offline
That looks much better. In Richard Yot's tutorial, he is using the layer based shader system in Modo - which is very similar to Photoshop and 3Dcoat. It is easy, for instance to set roughness to a certain value and then add a texture image map set to "add" or "multiply" and add another texture image map mask to control which area is affected. In the Principled shader, there are vector inputs for the rgb vector from an image for base color, roughness, metallic, transparency and several other channels. But there is none for bump, normal, or displacement. There is the baseN and vdisp but no clear way to set masks or blend modes for incoming texture channel data. Your surface color node and mix node look like they will work well as a better solution. I tried it in the model I'm working on and couldn't get it the replace the normal texture input, but I'll play around with tweaking the constants to see if I can fix that.

I was uncertain if I needed to create a material node, add nodes as you have done, or dive into the principled shader itself to make the changes. You've given me a good starting point.

Thank you.
Edited by Island - Jan. 9, 2022 23:29:00
  • Quick Links