Material functions would be far better if one could define parameters in them that can be exposed and contextualized instead of just putting them in the global namespace.
So I can define a group for them from the caller and make them unique using a namespace.
Say I have a generic “contrast brightness and offset” function.
If I Parametrize it directly in the function I should get 3 plain parameters “contrast”,“brightness” and “offset” in my material in the global namespace.
Say that I use this function twice, once on my roughness and once on a mask that define a color overlay and it will not work as they get exposed but shared.
On the other hand, with the contextualization improvement , you could create a namespace that makes a unique set of parameters and place them under a group always chosen on call and still in the caller we can have a sorting index to sort the inner params packed together in the outer group.
so In my example for a function having
Params
- contrast
- brightness
- offset
and a material using it twice once with Roughness namespace and group and sort 1 and the other with Overlay mask I will get this configuration in the material instance editor
Roughness
- other rough param
- Roughness.contrast
- Roughness.brightness
- Roughness.offset
- other rough param
OverlayMask
- other params
- OverlayMask.contrast
- OverlayMask.brightness
- OverlayMask.offset
- other params