How To Modulate Blended Textures

I’m trying to implement something similar to Valves blendmodulate feature to blend my textures together.
developer.valvesoftware.com/wiki/$blendmodulatetexture

In my case I have three textures blended together based on vertex colors RGB, with each vertex channel corresponding to the textures mask. The code is really simple and works well for linear blends-

            	fixed4 c = tex2D(_MainTex, i.uv1) * i.color.r);
                c += tex2D(_MainTex2, i.uv1) * i.color.g);
                c += tex2D(_MainTex3, i.uv1) * i.color.b;

What I would like to do is have non-linear blends between the textures based on a modulate texture, but I’m not sure of the math behind it. How would I “modulate” the vertex colors?

Doesnt modulate just mean multiply?

So you just add the extra texture to your shader and then instead of using the i.color.rgb you use the rgb you got from the texture via tex2D. Then it will be per-texel blending instead of per vertex.