T4M 2 TexturesBumped DLM.shader 1.2 KB

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