To give some context, this is the effect I am trying to accomplish for a particle system:
I’m modifying the Alpha Blended shader for Particles to accomplish this. Here is the texture I’m using and here is the relevent code:
fixed4 frag (v2f i) : COLOR
{
float4 col = 2.0f * i.color * tex2D(_MainTex, i.texcoord);
return (col.a > _Threshold) ? _TintColor : float4(0,0,0,0);
}
_TintColor here is the desired color (yellow in the example above). Currently, I’m using the col.a (which is the alpha of the output color) to compare to the threshold. This however does not work because this alpha value is only for the one particle, not the alpha of the overlapped particles, so all I get is circles of solid colors, which is not what I need.
Now what I do need is a way to get the alpha value of the overlapped particles to correctly implement the method described in the demonstration mentioned above. Is this possible?