ARShadow.shader 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Shader "Imagine/ARShadow"
  2. {
  3. Properties
  4. {
  5. _ShadowIntensity ("Intensity", Range (0, 1)) = 0.75
  6. }
  7. SubShader
  8. {
  9. Tags {"Queue"="AlphaTest" }
  10. Pass
  11. {
  12. Tags {"LightMode" = "ForwardBase" }
  13. Cull Back
  14. Blend SrcAlpha OneMinusSrcAlpha
  15. CGPROGRAM
  16. #pragma vertex vert
  17. #pragma fragment frag
  18. #pragma multi_compile_fwdbase
  19. #include "UnityCG.cginc"
  20. #include "AutoLight.cginc"
  21. uniform float _ShadowIntensity;
  22. struct v2f
  23. {
  24. float4 pos : SV_POSITION;
  25. LIGHTING_COORDS(0,1)
  26. };
  27. v2f vert(appdata_base v)
  28. {
  29. v2f o;
  30. o.pos = UnityObjectToClipPos (v.vertex);
  31. TRANSFER_VERTEX_TO_FRAGMENT(o);
  32. return o;
  33. }
  34. fixed4 frag(v2f i) : COLOR
  35. {
  36. float attenuation = LIGHT_ATTENUATION(i);
  37. return fixed4(0,0,0,(1-attenuation)*_ShadowIntensity);
  38. }
  39. ENDCG
  40. }
  41. }
  42. Fallback "VertexLit"
  43. }