Need help, vertex alpha texture blend with vertex colours

Hi,

Im trying to make a simple shader that blends 2 textures based on the vertex alpha BUT also has the RGB of the vertex colour multiplied into both textures,
im an artist not a coder so I have found an example of how to blend the 2 textures using the vertex alpha component and I added the vertex colour to the first texture but i cant seem to get the vertex colours multiplied into the 2nd texturemap no matter what i try, i either get the vertex colours but no alpha blend or the alpha blend and no colours :frowning:

Im sure its super simple to do if you know what your doing but i dont lol :slight_smile:

this is what i have just now

Shader "John/TextureBlendVTXColour" {

Properties {
	_MainTex ("Texture 1 (white vertex A)", 2D) = ""
	_Texture2 ("Texture 2  (black vertex A) ", 2D) = ""
}

SubShader {
	BindChannels {
		Bind "vertex", vertex
		Bind "color", color
		Bind "texcoord", texcoord
	}
	
	Pass {

		SetTexture [_MainTex]	{Combine primary * texture} 
		SetTexture [_Texture2]  {Combine previous Lerp(primary) texture}
	}
}

}

this blends 2 textures but only the first texture has the vertex colours multiplied into the texture, any help would be fantastic.

You should be able to do it with just one more texture operation:

	SetTexture [_Texture2]  {
		Combine previous * primary, previous
	}

Note that the comma allows you to apply different operators to the RGB and A channels. In this case we leave the alpha channel alone, but multiply the result of the previous operation by the vertex colour. Texture 2 is not actually used again.

AWESOME, cheers dude thats perfect.I was not using the comma so thats good to know :smile: