AlphaBlendTransition.shader 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Shader "Custom/AlphaBlendTransition" {
  2. Properties {
  3. _Color ("Color", Color) = (1,1,1,1)
  4. _Blend ("Texture Blend", Range(0,1)) = 0.0
  5. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  6. _MainTex2 ("Albedo 2 (RGB)", 2D) = "white" {}
  7. _BumpMap ("Bumpmap", 2D) = "bump" {}
  8. _BumpScale("Scale", Float) = 1.0
  9. _SpecGlossMap("Roughness Map", 2D) = "gloss" {}
  10. _MetallicGlossMap("Metallic", 2D) = "white" {}
  11. }
  12. SubShader {
  13. Tags { "RenderType"="Opaque" }
  14. LOD 200
  15. CGPROGRAM
  16. #pragma surface surf Standard fullforwardshadows
  17. #pragma target 3.0
  18. #pragma shader_feature _NORMALMAP
  19. #pragma shader_feature _METALLICGLOSSMAP
  20. #pragma shader_feature _SPECGLOSSMAP
  21. struct Input {
  22. float2 uv_MainTex;
  23. float2 uv_MainTex2;
  24. float2 uv_BumpMap;
  25. };
  26. sampler2D _MainTex;
  27. sampler2D _MainTex2;
  28. sampler2D _BumpMap;
  29. sampler2D _MetallicGlossMap;
  30. half _Blend;
  31. fixed4 _Color;
  32. void surf (Input IN, inout SurfaceOutputStandard o) {
  33. fixed4 c = lerp (tex2D (_MainTex, IN.uv_MainTex), tex2D (_MainTex2, IN.uv_MainTex2), _Blend) * _Color;
  34. o.Albedo = c.rgb;
  35. fixed4 metal = tex2D (_MetallicGlossMap, IN.uv_MainTex);
  36. o.Metallic = metal.r;
  37. o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
  38. o.Alpha = c.a;
  39. }
  40. ENDCG
  41. }
  42. FallBack "Diffuse"
  43. }