I've made a spine shader that supports HUE recolor based on Spine-Skeleton shader, by slightly editing float4 frag of the Normal pass. This shader is used only occasionally, because only a small number of attachments needs HUE recoloring. When I need to replace the material, I do this:
var HUE_Material = new Material(HUE_Shader);
HUE_Material.CopyPropertiesFromMaterial(All_Slots[s].Attachment.GetMaterial());
HUE_Material.SetFloat("_HueSin", Mathf.Sin(our_chibi.Clothes_Hue[color_slot.Key]));
HUE_Material.SetFloat("_HueCos", Mathf.Cos(our_chibi.Clothes_Hue[color_slot.Key]));
our_chibi_skeleton.CustomSlotMaterials[All_Slots[s]] = HUE_Material;
It works great in editor, but I've noticed graphical artifacts in build. Turns out this part of the HUE shader doesn't work in builds:
#if defined(_STRAIGHT_ALPHA_INPUT)
texColor.rgb *= texColor.a;
#endif
and to solve this issue I removed the condition from the HUE shader, since straight alpha input is always used by our skeletons anyway. Now it's just texColor.rgb *= texColor.a.
I'm not sure why it happens though. I copy the properties of the non-HUE material which straight alpha is always on, and it works as intended in the editor. Perhaps there is a bug of some kind that affects only builds?
I'm using the newest 3.8 runtime and URP shaders.