PolyRimLightTransparent.shader 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Shader "PolygonArsenal/PolyRimLightTransparent"
  2. {
  3. Properties
  4. {
  5. _InnerColor ("Inner Color", Color) = (1.0, 1.0, 1.0, 1.0)
  6. _RimColor ("Rim Color", Color) = (0.26,0.19,0.16,0.0)
  7. _RimWidth ("Rim Width", Range(0.2,20.0)) = 3.0
  8. _RimGlow ("Rim Glow Multiplier", Range(0.0,9.0)) = 1.0
  9. }
  10. SubShader
  11. {
  12. Tags { "Queue" = "Transparent" "RenderType"="Transparent" }
  13. Cull Back
  14. Lighting Off
  15. Blend One One
  16. CGPROGRAM
  17. #pragma surface surf Lambert
  18. struct Input
  19. {
  20. float3 viewDir;
  21. };
  22. float4 _InnerColor;
  23. float4 _RimColor;
  24. float _RimWidth;
  25. float _RimGlow;
  26. void surf (Input IN, inout SurfaceOutput o)
  27. {
  28. o.Albedo = _InnerColor.rgb;
  29. half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
  30. o.Emission = _RimColor.rgb * _RimGlow * pow (rim, _RimWidth);
  31. }
  32. ENDCG
  33. }
  34. Fallback "Diffuse"
  35. }