Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. Shader "ImperiumTerrain/Lightmap-FirstPass" {
  2. Properties {
  3. _Control ("Control (RGBA)", 2D) = "red" {}
  4. _Splat3 ("Layer 3 (A)", 2D) = "white" {}
  5. _Splat2 ("Layer 2 (B)", 2D) = "white" {}
  6. _Splat1 ("Layer 1 (G)", 2D) = "white" {}
  7. _Splat0 ("Layer 0 (R)", 2D) = "white" {}
  8. // used in fallback on old cards
  9. _MainTex ("BaseMap (RGB)", 2D) = "white" {}
  10. _Color ("Main Color", Color) = (1,1,1,1)
  11. }
  12.  
  13. SubShader {
  14. Tags {
  15. "SplatCount" = "4"
  16. "Queue" = "Geometry-100"
  17. "RenderType" = "Opaque"
  18. }
  19. CGPROGRAM
  20. #pragma surface surf Lambert
  21. struct Input {
  22. float2 uv_Control : TEXCOORD0;
  23. float2 uv_Splat0 : TEXCOORD1;
  24. float2 uv_Splat1 : TEXCOORD2;
  25. float2 uv_Splat2 : TEXCOORD3;
  26. float2 uv_Splat3 : TEXCOORD4;
  27. };
  28.  
  29. sampler2D _Control;
  30. sampler2D _Splat0,_Splat1,_Splat2,_Splat3;
  31.  
  32. void surf (Input IN, inout SurfaceOutput o) {
  33. half4 splat_control = tex2D (_Control, IN.uv_Control);
  34. half3 col;
  35. col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb;
  36. col += splat_control.g * tex2D (_Splat1, IN.uv_Splat1).rgb;
  37. col += splat_control.b * tex2D (_Splat2, IN.uv_Splat2).rgb;
  38. col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb;
  39. o.Albedo = col;
  40. o.Alpha = 0.0;
  41. }
  42. ENDCG
  43. }
  44.  
  45. // Fallback to Diffuse
  46. Fallback "Diffuse"
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement