How to correctly layer multiple surfaces with MaterialX?

   536   2   0
User Avatar
Member
3 posts
Joined: Sept. 2022
Offline
I am trying to figure out how to best create a multi-layer material for use on a landscape or other objects where I want to blend multiple materials/surfaces using masks.

Right now I have a MaterialX material with multiple MaterialX Standard Surface shaders. I can use the MaterialX 'mix' node with a mask to successfully 'layer' one surface atop another but when I add a third mix node and try to blend a third surface shader I only see the vertex colors of the object instead of any material.

Limited troubleshooting seems to indicate that I cannot use additional mix nodes to layer more shaders for some reason. The mix node works fine in other scenarios where I am using multiple of them in succession to layer textures instead of surfaces, however.

I know I can accomplish this sort of layering with a single surface shader by just mixing multiple sets of texture channels using masks instead of mixing surfaces, but I want to explore using layered surfaces instead due to the simplified network.

Attached are some images showing the material setup using the vertex colors as masks as well as a the .hiplc file. In the second image you can see how trying to blend a third surface fails.

I am wondering if I am just setting this up wrong or if there is a more correct way to do this type of masking/layering of shaders.
Edited by Nicholaswillis - Oct. 26, 2024 19:07:03

Attachments:
Blending_two_surfaces_works.png (1.4 MB)
Blending_three_or_more_surfaces_does_not_work.png (1.1 MB)
Layered_Material_Setup.hiplc (761.1 KB)

User Avatar
Member
3 posts
Joined: Nov. 2016
Offline
It would seem like this is currently only supported in Karma CPU
Will Karma XPU support mixing more than two MtlX materials? [www.sidefx.com]
User Avatar
Member
729 posts
Joined: July 2005
Offline
Nicholaswillis
I know I can accomplish this sort of layering with a single surface shader by just mixing multiple sets of texture channels using masks instead of mixing surfaces

This is what you'll have to do for the time being. The devs have said they'd like to tackle mixing more than two Standard Surface materials with XPU, but that it won't be a quick and easy thing to pull off (paraphrasing here).
  • Quick Links