Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Shader "Unlit/PP/PSTexturaEscalable"
  2. {
  3.  
  4. Properties{
  5. _MainTex("Base (RGB)", 2D) = "" {}
  6.  
  7. _SubTex("Base (RGB)", 2D) = "" {}
  8.  
  9. _LerpTex("Lerp", 2D) = "" {}
  10.  
  11. _Color("Colorfijo", Color) = (1.0, 0.0, 0.0)
  12. }
  13.  
  14. SubShader
  15. {
  16. Pass
  17. {
  18. CGPROGRAM
  19.  
  20. #pragma vertex vsMain
  21. #pragma fragment psMain
  22.  
  23. #include "UnityCG.cginc"
  24.  
  25. sampler2D _MainTex;
  26. float4 _MainTex_ST;
  27.  
  28. sampler2D _SubTex;
  29. float4 _SubTex_ST;
  30.  
  31. sampler2D _LerpTex;
  32. float4 _LerpTex_ST;
  33.  
  34. float4 _Color;
  35.  
  36. struct VsIn {
  37. float4 vertex : POSITION;
  38. float2 texcoord : TEXCOORD0;
  39. };
  40.  
  41. struct VsOut {
  42. float4 pos : SV_POSITION;
  43. float2 uv : TEXCOORD0;
  44. float2 uv1 : TEXCOORD1;
  45. float2 uv2 : TEXCOORD2;
  46. };
  47.  
  48. VsOut vsMain(appdata_base v) {
  49. VsOut o;
  50. o.pos = UnityObjectToClipPos(v.vertex);
  51. o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
  52. o.uv1 = TRANSFORM_TEX(v.texcoord, _SubTex);
  53. o.uv2 = TRANSFORM_TEX(v.texcoord, _LerpTex);
  54. return o;
  55. };
  56.  
  57. float4 psMain(VsOut i) : COLOR {
  58. return lerp(tex2D(_MainTex, i.uv), tex2D(_SubTex, i.uv1), tex2D(_LerpTex, i.uv2).a);
  59. }
  60.  
  61. ENDCG
  62.  
  63.  
  64.  
  65.  
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement