vertex color RGB modulate2x, plus vertex alpha blending textures

Hey guys, not sure if someone can help me out with this, but I got 2 shaders, one that blends 2 textures by the vertex alpha information and one that modulates the vertex RGB values into the texture.

I was wondering if someone can help me trying to do both desired effects together so I have vertex RGB still modulating and A channel of the mesh doing the texture blending.

Here’s the 2 shaders:

Shader "Blend 2 by Vertex Alpha" {

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

SubShader
{
   BindChannels
   {
      Bind "vertex", vertex
      Bind "color", color
      Bind "texcoord", texcoord
   }
   
   Pass
   {
      SetTexture [_MainTex]
      SetTexture [_Texture2] {
			combine previous lerp(primary) texture
	  }
   }
}

 
}
Shader  "Vertex Color Unlit" {

Properties {
    _Color ("Color", Color) = (1,1,1,1)
    _MainTex ("Texture", 2D) = "white" {}
}

Category {
	//AlphaTest Greater 0.5
    Tags { "Queue"="Geometry" }
    Lighting Off
    BindChannels {
        Bind "Color", color
        Bind "Vertex", vertex
        Bind "TexCoord", texcoord
    }
   
    // ---- Dual texture cards
    SubShader {
        Pass {
            SetTexture [_MainTex] {
                combine texture * primary
            }
            SetTexture [_MainTex] {
                constantColor [_Color]
                combine previous lerp (previous) constant DOUBLE
            }
			SetTexture [_Texture2] {
			combine previous lerp(primary) texture
        }
    }
   }
}

Next time, please make an effort and list what confusion you have about why you can’t get it to work.

Shader "Vertex Thang" {

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

Category {
	BindChannels {
		Bind "vertex", vertex
		Bind "color", color
		Bind "texcoord", texcoord
	}

	SubShader {Pass {
		SetTexture [_MainTex]
		SetTexture [_Texture2] {Combine previous Lerp(primary) texture}
		SetTexture [_] {Combine previous * primary Double}
	} }
	
	SubShader {
		Pass {
			SetTexture [_MainTex]
			SetTexture [_Texture2] {Combine previous Lerp(primary) texture}
		}
		Pass {Blend DstColor SrcColor}
	}
}

}

Thanks Jessy, now I see what you did. I will give it a try! :slight_smile:

I was wondering, why do you need another SubShader for this?

Is it possible to do 1 SubShader only?

Does it cost more having another SubShader?

That allows the least powerful cards I care about to run the shader, and maybe I hoped it would help you learn something? I guess I’m just used to making a low-end SubShader for old iOS devices.

Sure. Read up on SubShaders. I don’t think they are what you think they are.

I don’t imagine so; I’ve never heard anything that would suggest it, but I don’t actually know at this time. You could try asking at Unity Answers.

That’s ok, you answered everything I needed, thanks man!