bladynator :Removing that last line (col.a *= _Alpha) doesn't change much,
That's why I wrote
like texture.rgb *= texture.a; or similar.
You were one line of code off with your modification, the line above should have been removed.
Every pre-multiplication of the base color (color.rgb
) by an alpha value has to be removed when you want to turn pre-multiplied alpha into normal straight alpha.
BTW: your shader is incorrect anyway, as it performs col.a *= _Alpha
after the alpha pre-multiplication statement instead of before.
bladynator : and adding your suggested line after it doesn't do much either.
I did not suggest to add any line after existing code. If you meant the #if DEFINITION
section, then this needs to be wrapped around the code, not added afterwards.
bladynator :Yes, you understood that correctly. I override every shader in every material that Spine2D makes. (which is currently just 1 material with 1 shader, so the foreach only loops once).
The main question was:
Are you copying between materials using the same shader?
But I guess you are. If you were copying properties between a Material with a Spine shader and a custom non-Spine shader, then things will only work by chance.
In general, please always tell us up-front when you are not using Spine shaders but custom ones.