SFE_TransparentRim.shader 931 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Shader "SF_EFFECTS/TransparentRim" {
  2. Properties {
  3. _RimColor ("Rim Color", Color) = (0.5,0.5,0.5,0.5)
  4. _InnerColor ("Inner Color", Color) = (0.5,0.5,0.5,0.5)
  5. _InnerColorPower ("Inner Color Power", Range(0.0,1.0)) = 0.5
  6. _RimPower ("Rim Power", Range(0.0,5.0)) = 2.5
  7. _AlphaPower ("Alpha Rim Power", Range(0.0,8.0)) = 4.0
  8. _AllPower ("All Power", Range(0.0, 10.0)) = 1.0
  9. }
  10. SubShader {
  11. Tags { "Queue" = "Transparent" }
  12. CGPROGRAM
  13. #pragma surface surf Lambert alpha
  14. struct Input {
  15. float3 viewDir;
  16. INTERNAL_DATA
  17. };
  18. float4 _RimColor;
  19. float _RimPower;
  20. float _AlphaPower;
  21. float _AlphaMin;
  22. float _InnerColorPower;
  23. float _AllPower;
  24. float4 _InnerColor;
  25. void surf (Input IN, inout SurfaceOutput o) {
  26. half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
  27. o.Emission = _RimColor.rgb * pow (rim, _RimPower)*_AllPower+(_InnerColor.rgb*2*_InnerColorPower);
  28. o.Alpha = (pow (rim, _AlphaPower))*_AllPower;
  29. }
  30. ENDCG
  31. }
  32. Fallback "VertexLit"
  33. }