T4M 3 Textures.shader 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Shader "T4MShaders/ShaderModel2/Diffuse/T4M 3 Textures" {
  2. Properties {
  3. _Splat0 ("Layer 1", 2D) = "white" {}
  4. _Splat1 ("Layer 2", 2D) = "white" {}
  5. _Splat2 ("Layer 3", 2D) = "white" {}
  6. _Control ("Control (RGBA)", 2D) = "white" {}
  7. _MainTex ("Never Used", 2D) = "white" {}
  8. }
  9. SubShader {
  10. Tags {
  11. "SplatCount" = "3"
  12. "RenderType" = "Opaque"
  13. }
  14. CGPROGRAM
  15. #pragma surface surf Lambert
  16. #pragma exclude_renderers xbox360 ps3
  17. struct Input {
  18. float2 uv_Control : TEXCOORD0;
  19. float2 uv_Splat0 : TEXCOORD1;
  20. float2 uv_Splat1 : TEXCOORD2;
  21. float2 uv_Splat2 : TEXCOORD3;
  22. };
  23. sampler2D _Control;
  24. sampler2D _Splat0,_Splat1,_Splat2;
  25. void surf (Input IN, inout SurfaceOutput o) {
  26. fixed3 splat_control = tex2D (_Control, IN.uv_Control).rgba;
  27. fixed3 lay1 = tex2D (_Splat0, IN.uv_Splat0);
  28. fixed3 lay2 = tex2D (_Splat1, IN.uv_Splat1);
  29. fixed3 lay3 = tex2D (_Splat2, IN.uv_Splat2);
  30. o.Alpha = 0.0;
  31. o.Albedo.rgb = (lay1 * splat_control.r + lay2 * splat_control.g + lay3 * splat_control.b );
  32. }
  33. ENDCG
  34. }
  35. ////FallBack "Diffuse"
  36. }