Advertisement
Guest User

AR Shadow

a guest
Feb 23rd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2.  
  3. Shader "UnlitShadows/UnlitShadowReceive" {
  4. Properties{ _Color("Main Color", Color) = (1,1,1,1) _MainTex("Base (RGB)", 2D) = "white" {} _Cutoff("Cutout", Range(0,1)) = 0.5 }
  5. SubShader{ Pass{ Alphatest Greater[_Cutoff] SetTexture[_MainTex] }  Pass{ Blend DstColor Zero Tags{ "LightMode" = "ForwardBase" }
  6. CGPROGRAM
  7. #pragma vertex vert
  8. #pragma fragment frag
  9. #include "UnityCG.cginc"
  10. #pragma multi_compile_fwdbase
  11. #include "AutoLight.cginc"
  12. struct v2f {
  13. float4 pos : SV_POSITION; LIGHTING_COORDS(0,1) };
  14. v2f vert(appdata_base v) {
  15. v2f o; o.pos = UnityObjectToClipPos(v.vertex); TRANSFER_VERTEX_TO_FRAGMENT(o);
  16. return o; }
  17. fixed4 frag(v2f i) : COLOR{
  18. float attenuation = LIGHT_ATTENUATION(i);
  19. return attenuation;
  20. } ENDCG } } Fallback "Transparent/Cutout/VertexLit" }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement