Guest User

Untitled

a guest
May 21st, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Shader "Decal" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB)", 2D) = "white" {}
  5. _DecalTex ("Decal (RGBA)", 2D) = "black" {}
  6. }
  7.  
  8. SubShader {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 250
  11.  
  12. CGPROGRAM
  13. #pragma surface surf Lambert
  14.  
  15. sampler2D _MainTex;
  16. sampler2D _DecalTex;
  17. fixed4 _Color;
  18.  
  19. struct Input {
  20. float2 uv_MainTex;
  21. float2 uv_DecalTex;
  22. };
  23.  
  24. void surf (Input IN, inout SurfaceOutput o) {
  25. fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
  26. half4 decal = tex2D(_DecalTex, IN.uv_DecalTex);
  27. c.rgb = lerp (c.rgb, decal.rgb, decal.a);
  28. c *= _Color;
  29. o.Albedo = c.rgb *4 ;
  30. o.Alpha = c.a;
  31. }
  32. ENDCG
  33. }
  34.  
  35. Fallback "Diffuse"
  36. }
Add Comment
Please, Sign In to add comment