Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2.  
  3. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  4.  
  5. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  6.  
  7. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  8.  
  9. // Made with Amplify Shader Editor
  10. // Available at the Unity Asset Store - http://u3d.as/y3X
  11.  
  12. Shader "TransparentWithShadows" {
  13.    
  14.     Properties
  15.     {
  16.         _Color ("Main Color", Color) = (1,1,1,.5)
  17.         _ShadowIntensity ("Shadow Intensity", Range (0, 1)) = 0.6
  18.     }
  19.     SubShader
  20.     {
  21.         Tags {"Queue"="AlphaTest" }
  22.         Pass
  23.         {
  24.             Tags {"LightMode" = "ForwardBase" }
  25.             Cull Back
  26.             Blend SrcAlpha OneMinusSrcAlpha
  27.             CGPROGRAM
  28.             #pragma vertex vert
  29.             #pragma fragment frag
  30.             #pragma multi_compile_fwdbase
  31.             #include "UnityCG.cginc"
  32.             #include "AutoLight.cginc"
  33.             uniform fixed4  _Color;
  34.             uniform float _ShadowIntensity;
  35.             struct v2f
  36.             {
  37.                 float4 pos : SV_POSITION;
  38.                 LIGHTING_COORDS(0,1)
  39.             };
  40.             v2f vert(appdata_base v)
  41.             {
  42.                 v2f o;
  43.                 o.pos = UnityObjectToClipPos (v.vertex);
  44.                 TRANSFER_VERTEX_TO_FRAGMENT(o);
  45.              
  46.                 return o;
  47.             }
  48.             fixed4 frag(v2f i) : COLOR
  49.             {
  50.                 float attenuation = LIGHT_ATTENUATION(i);
  51.                 return fixed4(0,0,0,(1-attenuation)*_ShadowIntensity) * _Color;
  52.             }
  53.             ENDCG
  54.         }
  55.     }
  56.  
  57.     /*
  58.     Properties {
  59.         _MainTex("Base (RGB)", 2D) = "white" {}
  60.     }
  61.  
  62.     SubShader   {
  63.    
  64.         Pass {
  65.  
  66.             Blend One One
  67.            
  68.             Tags { "LightMode" = "ForwardAdd" }
  69.  
  70.             CGPROGRAM
  71.             #pragma vertex vert
  72.             #pragma fragment frag
  73.             #pragma multi_compile_fwdadd_fullshadows
  74.        
  75.             #include "UnityCG.cginc"
  76.             #include "AutoLight.cginc"
  77.  
  78.             sampler2D _MainTex;
  79.             float4 _MainTex_ST;
  80.        
  81.             struct v2f {
  82.                 float4 pos : SV_POSITION;
  83.                 LIGHTING_COORDS(0,1)
  84.                 float2 uv : TEXCOORD2;
  85.             };
  86.  
  87.             v2f vert(appdata_base v) {
  88.                 v2f o;
  89.                 o.pos = UnityObjectToClipPos(v.vertex);
  90.                 o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
  91.                 TRANSFER_VERTEX_TO_FRAGMENT(o);
  92.                 return o;
  93.             }
  94.  
  95.             fixed4 frag(v2f i) : COLOR {
  96.                 float attenuation = LIGHT_ATTENUATION(i);
  97.                 return tex2D(_MainTex, i.uv) * attenuation;
  98.             }
  99.    
  100.             ENDCG
  101.         }
  102.     }
  103.     */
  104.  
  105.     Fallback "VertexLit"
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement