T4M 3 TexturesBumped DLM.shader 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Shader "T4MShaders/ShaderModel2/BumpDLM/T4M 3 Textures Bumped DLM" {
  2. Properties {
  3. _Splat0 ("Layer 1", 2D) = "white" {}
  4. _Splat1 ("Layer 2", 2D) = "white" {}
  5. _Splat2 ("Layer 3", 2D) = "white" {}
  6. _BumpSplat0 ("Layer1Normalmap", 2D) = "bump" {}
  7. _BumpSplat1 ("Layer2Normalmap", 2D) = "bump" {}
  8. _BumpSplat2 ("Layer3Normalmap", 2D) = "bump" {}
  9. _Control ("Control (RGBA)", 2D) = "white" {}
  10. _MainTex ("Never Used", 2D) = "white" {}
  11. }
  12. SubShader {
  13. Tags {
  14. "SplatCount" = "3"
  15. "RenderType" = "Opaque"
  16. }
  17. CGPROGRAM
  18. #pragma surface surf Lambert exclude_path:prepass
  19. #pragma exclude_renderers xbox360 ps3 flash
  20. struct Input {
  21. float2 uv_Control : TEXCOORD0;
  22. float2 uv_Splat0: TEXCOORD1;
  23. float2 uv_Splat1 : TEXCOORD2;
  24. float2 uv_Splat2 : TEXCOORD3;
  25. };
  26. sampler2D _Control;
  27. sampler2D _Splat0, _Splat1,_Splat2;
  28. sampler2D _BumpSplat0,_BumpSplat1,_BumpSplat2;
  29. void surf (Input IN, inout SurfaceOutput o) {
  30. fixed3 splat_control = tex2D (_Control, IN.uv_Control).rgb;
  31. fixed3 lay1 = tex2D (_Splat0, IN.uv_Splat0).rgb;
  32. fixed3 lay2 = tex2D (_Splat1, IN.uv_Splat1).rgb;
  33. fixed3 lay3 = tex2D (_Splat2, IN.uv_Splat2).rgb;
  34. o.Alpha = 0.0;
  35. o.Albedo.rgb = (lay1 * splat_control.r + lay2 * splat_control.g+ lay3 * splat_control.b);
  36. fixed3 lay1B = UnpackNormal (tex2D(_BumpSplat0, IN.uv_Splat0));
  37. fixed3 lay2B = UnpackNormal (tex2D(_BumpSplat1, IN.uv_Splat1));
  38. fixed3 lay3B = UnpackNormal (tex2D(_BumpSplat2, IN.uv_Splat2));
  39. o.Normal = (lay1B * splat_control.r + lay2B * splat_control.g+ lay3B * splat_control.b);
  40. }
  41. ENDCG
  42. }
  43. // Fallback to Diffuse
  44. //FallBack "Diffuse"
  45. }