vB_Diffuse_3tex.shader 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Shader "vertexPainter/vB_Diffuse_3tex" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _MainTex1 ("Texture 1 (RGB)", 2D) = "white" {}
  5. _MainTex2 ("Texture 2 (RGB)", 2D) = "white" {}
  6. _MainTex3 ("Texture 2 (RGB)", 2D) = "white" {}
  7. }
  8. SubShader {
  9. Tags { "RenderType" = "Opaque" }
  10. CGPROGRAM
  11. #pragma surface surf Lambert vertex:vert
  12. struct Input {
  13. float2 uv_MainTex1 : TEXCOORD0;
  14. float2 uv_MainTex2 : TEXCOORD1;
  15. float2 uv_MainTex3 : TEXCOORD2;
  16. float4 color : TEXCOORD3;
  17. };
  18. void vert (inout appdata_full v, out Input o)
  19. {
  20. UNITY_INITIALIZE_OUTPUT(Input,o);
  21. o.color = (v.color);
  22. }
  23. uniform sampler2D _MainTex1, _MainTex2, _MainTex3;
  24. fixed4 _Color;
  25. fixed _Tile;
  26. void surf (Input IN, inout SurfaceOutput o) {
  27. fixed4 col = tex2D( _MainTex1, IN.uv_MainTex1)*IN.color.r;
  28. col += tex2D( _MainTex2, IN.uv_MainTex2)*IN.color.g;
  29. col += tex2D( _MainTex3, IN.uv_MainTex3)*IN.color.b;
  30. o.Albedo = col * _Color.rgb;
  31. }
  32. ENDCG
  33. }
  34. }