The Blend on the shader is set as:
Blend One OneMinusSrcAlpha, One OneMinusSrcAlpha
Doing so I can control if the shader is additive by setting the alpha as zero and keeping the color. It is useful to create an ‘Blend Add’ effect when the alpha is between 0 and 1. This trick has worked so far, works on Unity 2020, but in Unity 2021 for some reason it behaves the same as having Blend SrcAlpha OneMinusSrcAlpha, so the material is just invisible with alpha zero, instead of being additive.
Is this a bug or there’s any settings able to mess up with the blend somewhere on the settings?
so, the way you describe it is that if you set alpha to 0 in 2021, you don’t see the object at all, correct? What happens if you set alpha to 0.1? does it still give a result different from what you see in 2020?
Yea, it works just as a alpha blended shader. As I’m multiplying the color by the alpha you get a particle with dark edges, then as you reduce the alpha it gets darker and more transparent.
I recorded this video. You can see that the texture is just a gradient, and the alpha has 3 different values. I even used the included shaders to make sure it wasn’t a amplify bug. The Alpha and PreMultiplied look the same, whereas the preMultiplied was supposed to have an additive gradient on the top
For anyone interested, the problem seems to be that something is forcingly multiplying the alpha on the color (probably so you wouldn’t need to do it yourself when writing the shader). So I ended up dividing the color by the alpha to cancel that out.
And yea, it does involve dividing colors by zero to have an additive shader. I hope it doesn’t look crazy on some mobile GPUs