Hi. In the unity documentation here http://docs.unity3d.com/Documentation/Components/SL-Blend.html it says you are able to set different blend factors for alpha and color channels. When I try giving the shader more factors nothing changes. The first two factors are used but the second two are ignored completely. Blend SrcAlpha OneMinusSrcAlpha, DstAlpha OneMinusDstAlpha is no different from Blend SrcAlpha OneMinusSrcAlpha. I can't find any examples of this being used and have no idea what I could be doing wrong. Has anyone come across similar problems?
The specific values you're using won't ever show a difference. You'd have to be using DestAlpha for the colors, and have three+ overlapping textures. The third one would have the change. A rundown:
Commonly you ignore the alpha of the screen pixel, which means there's no point caring about alpha blend factor. Using SrcAlpha OneMinusSrcAlpha means that a fog pixel with an alpha of 20% will blend 20/80 with the background pixel. That's normally what you want. Even if the background was a complex combo of glass and fog, yellow 20% fog over it will tint it 20% towards yellow.
Now, the new alpha probably be 100%80% + 20%20% = 84%. That's a stupid value, but who cares, since no one will ever look at it. The next fog plane will use it's own alpha/1-alpha.
Say you were using DestAlpha OneMinusDestAlpha for the blend. Then the base pixel's alpha would control the final color. It's hard to think of a time you'd want that. Since, look at any transparent texture and think about swapping in a different alpha channel. Ick.
But, if you did, then after blending two textures, you'd have a new Alpha in that pixel, which the next DestAlpha OneMinusDestAlpha would look at. So you might use DA OmDa Sa OmSa, to make a chain letter: "I ignore my alpha when I blend with something (I use yours,) but the next guy has to use mine."
answered Aug 19, 2013 at 01:39 PM