0
$\begingroup$

I'm currently designing my first custom node in order to be able to apply variations of the same complex shader to multiple objects.

enter image description here

The green highlighted values are linked to color ramps sliders in the node group via drivers and data paths. To be able to control those sliders, each of their drivers are set to use Material ID-block and linked to the specific material the node group is a part of.

enter image description here

The issue is that I can't figure out how to duplicate this group node and have the duplicates have their own driver set-up. So while those duplicates can have their own hatching scale and base color because their directly linked to nodes in the node group, the cluster border size, hard shadow start and others are all linked to the same material across all duplicates because of the drivers.

EDIT //. After Gorgious' answer, I tried to use custom properties instead of drivers but I'm still not quite there yet. My new method is as follows.

After selecting an object, I go to the material tab and create a new custom property of which I copy the data path.

enter image description here

I then go inside my node group to any given color ramp sliders I want to control and create a driver set up like this :

enter image description here

I then go the group node and add an attribute node to the corresponding input.

enter image description here

But the issue stays the same and even after having repeated this same set-up for another material, the attribute nodes of each material control both. I have those multiple materials, each having their own attribute node, each displaying different custom property names, acting over different drivers and yet, it's all linked.

I tried the same thing with a custom property created on the object tab rather than the material one. Same results. I also tried to get rid of the driver, linking the attribute node and the slider only via the custom property name but then, it does nothing.

Where did I go wrong?

$\endgroup$
2
  • $\begingroup$ Hello ! You don't want to use drivers because only one driver can drive the value of the node group. I think you'd rather want to use custom attributes on your objects and an Attribute node set to Object type $\endgroup$
    – Gorgious
    Commented Nov 15, 2023 at 15:33
  • $\begingroup$ Thank you, it sounds like a solution. But I'm not enough of a pro to fully understand what your saying. Could I bother you to be more specific? $\endgroup$ Commented Nov 15, 2023 at 15:52

2 Answers 2

1
$\begingroup$

If you need controllable inputs it is worth considering replacing Color Ramp nodes with something else. For example, the one in your hard shadow example can simply be replaced by Map Range node that has inputs, so there is no need for all the extra work with drivers. There might be cases where Color Ramp might be more difficult to replace, but in many cases it's possible.

enter image description here

$\endgroup$
3
  • $\begingroup$ Hey! Thank you so much, that did the trick! Everything is working as expected except for a tiny little bit: One of the color ramp I want to control is set to constant instead of linear. But the Map Range node doesn't give me the constant option. What should I add/do/change to make that happen? $\endgroup$ Commented Nov 17, 2023 at 7:38
  • $\begingroup$ I think it can then just be Math node in Greater Than or Less Then modes. If you had a few colors in the color ramp, they can be added or multiplied together or you could use Mix Color mode to mask different colors. $\endgroup$ Commented Nov 17, 2023 at 7:55
  • $\begingroup$ Math/Greater Than works super fine. Thank you so much, I'm all set! $\endgroup$ Commented Nov 17, 2023 at 7:59
0
$\begingroup$

You may want to use custom properties on your individual objects and use them with an Attribute node set to Object type.

Something like that. All Suzannes share the same material.

enter image description here

$\endgroup$
1
  • $\begingroup$ I've edited my question. $\endgroup$ Commented Nov 15, 2023 at 18:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .