Jump to content
monomind

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×