6TexturesUnlitNoLM.shader 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "T4MShaders/ShaderModel2/Unlit/T4M 6 Textures Unlit NoLM" {
  3. Properties {
  4. _Splat0 ("Layer1 (RGB)", 2D) = "white" {}
  5. _Splat1 ("Layer2 (RGB)", 2D) = "white" {}
  6. _Splat2 ("Layer3 (RGB)", 2D) = "white" {}
  7. _Splat3 ("Layer4 (RGB)", 2D) = "white" {}
  8. _Splat4 ("Layer5 (RGB)", 2D) = "white" {}
  9. _Splat5 ("Layer6 (RGB)", 2D) = "white" {}
  10. _Control ("Control (RGBA)", 2D) = "white" {}
  11. _Control2 ("Control2 (RGBA)", 2D) = "white" {}
  12. _MainTex ("Never Used", 2D) = "white" {}
  13. }
  14. SubShader {
  15. Pass {
  16. CGPROGRAM
  17. #include "UnityCG.cginc"
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. #pragma exclude_renderers xbox360 ps3
  21. sampler2D _Splat0 ;
  22. sampler2D _Splat1 ;
  23. sampler2D _Splat2 ;
  24. sampler2D _Splat3;
  25. sampler2D _Splat4;
  26. sampler2D _Splat5;
  27. sampler2D _Control;
  28. sampler2D _Control2;
  29. struct v2f {
  30. float4 pos : SV_POSITION;
  31. float2 uv[7] : TEXCOORD0;
  32. };
  33. float4 _Splat0_ST;
  34. float4 _Splat1_ST;
  35. float4 _Splat2_ST;
  36. float4 _Splat3_ST;
  37. float4 _Splat4_ST;
  38. float4 _Splat5_ST;
  39. float4 _Control_ST;
  40. v2f vert (appdata_full v)
  41. {
  42. v2f o;
  43. o.pos = UnityObjectToClipPos (v.vertex);
  44. o.uv[0] = TRANSFORM_TEX (v.texcoord, _Splat0);
  45. o.uv[1] = TRANSFORM_TEX (v.texcoord, _Splat1);
  46. o.uv[2] = TRANSFORM_TEX (v.texcoord, _Splat2);
  47. o.uv[3] = TRANSFORM_TEX (v.texcoord, _Splat3);
  48. o.uv[4] = TRANSFORM_TEX (v.texcoord, _Splat4);
  49. o.uv[5] = TRANSFORM_TEX (v.texcoord, _Splat5);
  50. o.uv[6] = TRANSFORM_TEX (v.texcoord, _Control);
  51. return o;
  52. }
  53. fixed4 frag (v2f i) : COLOR
  54. {
  55. fixed4 Mask = tex2D( _Control, i.uv[6].xy );
  56. fixed3 Mask2 = tex2D( _Control2, i.uv[6].xy ).rgb;
  57. fixed3 lay1 = tex2D( _Splat0, i.uv[0].xy );
  58. fixed3 lay2 = tex2D( _Splat1, i.uv[1].xy );
  59. fixed3 lay3 = tex2D( _Splat2, i.uv[2].xy );
  60. fixed3 lay4 = tex2D( _Splat3, i.uv[3].xy );
  61. fixed3 lay5 = tex2D( _Splat4, i.uv[4].xy );
  62. fixed3 lay6 = tex2D( _Splat5, i.uv[5].xy );
  63. fixed3 c2;
  64. c2.xyz = (lay4.xyz * Mask2.r + lay5.xyz * Mask2.g + lay6.xyz * Mask2.b);
  65. fixed4 c;
  66. c.xyz = (lay1.xyz * Mask.r + lay2.xyz * Mask.g + lay3.xyz * Mask.b + c2.xyz * Mask.a);
  67. c.w = 0;
  68. return c;
  69. }
  70. ENDCG
  71. }
  72. }
  73. }