Jump to content

Same material - Different Textures


Recommended Posts

I have a material that I use on multiple objects on my scene. The material is pretty complex with many parameters for reflectivity, bump, etc. (redshift)

To be able to use this material on different objects with differnt textures, I had to make copies of the material, and change the textures for each copy. But, for instance, when I want to control the reflectivity of the material, I have to go into each of those copies and make changes manually. Or, if I want to add another parameter/node to any connection on the material shader, again, I have to make changes to each material and copy, as they're using different textures.

So I'm wondering, if there is a way to keep one single material but use different textures for different objects that it's applied?

Link to comment
Share on other sites

They do but again, different materials need to be used.

What I want to achieve is - a single material that's used on all of my objects, that contain different textures.

One material to control and build, that'll grab the texture data from the applied object, somehow.

Link to comment
Share on other sites

I ran into something very similar recently.

You can use expressions in the filepaths. Like the $F for frame numbering, but then merge strings perhaps.

As an alternative, you can make a master surface, make a copy and link the channels to it " relative paramter references", combined with using the material nodes filename ( opname("..") I think) to use in the expressions.

Just some suggestions :)

Edited by Wout
Link to comment
Share on other sites

7 hours ago, monomind said:

They do but again, different materials need to be used.

What I want to achieve is - a single material that's used on all of my objects, that contain different textures.

One material to control and build, that'll grab the texture data from the applied object, somehow.

They are overrides, so you can use the same material just override the texture path if you want

In Mantra you can also use string attributes for this, not sure if RS supports such workflow

Link to comment
Share on other sites

I also do not have Red Shift, but you can check if inside red shift surface shader, houdini's BIND node works. If it works then you should be able to bind primitive's string attribute for texture name. In case if binding is working in RS only for non-string attributes, well, you can pass an integer attribute which would be representing let's say texture index and form full path+texturename+index+ext string inside shader and connect it in your texture name input. Also check if RS maybe has its own node for binding attributes, like Arnold.

Link to comment
Share on other sites

You can use the rsShaderMerge node.
With it you can load a texture, a rsMaterial or whatever from a rsMaterialBuilder into another.

In this example the cell noise noise is referenced in the mat2 from the mat1.
And the material1 is referenced and blended with material2 into the mat2

With this node I guess you can use a material that will serve as a "master material" with nodes referenced in all of your materials.

ShaderMerge.hipnc

ShaderMerge.jpg

Edited by flcc
Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...