You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
940 B

9 years ago
  1. Shader "Custom/ItemGlow" {
  2. Properties {
  3. _ColorTint("Color Tint", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB)", 2D) = "white" {}
  5. _BumpMap("Normal Map", 2D) = "bump" {}
  6. _RimColor("Rim Color", Color) = (1,1,1,1)
  7. _RimPower("Rim Power", Range(1.0,6.0)) = 3.0
  8. }
  9. SubShader {
  10. Tags { "RenderType"="Opaque" }
  11. CGPROGRAM
  12. #pragma surface surf Lambert
  13. struct Input {
  14. float4 color : Color;
  15. float2 uv_MainTex;
  16. float2 uv_BumpMap;
  17. float3 viewDir;
  18. };
  19. float4 _ColorTint;
  20. sampler2D _MainTex;
  21. sampler2D _BumpMap;
  22. float4 _RimColor;
  23. float _RimPower;
  24. void surf (Input IN, inout SurfaceOutput o) {
  25. IN.color = _ColorTint;
  26. o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb * IN.color;
  27. o.Normal = UnpackNormal (tex2D(_BumpMap, IN.uv_BumpMap));
  28. half rim = 1.0 -saturate(dot(normalize(IN.viewDir), o.Normal));
  29. o.Emission= _RimColor.rgb * pow(rim, _RimPower);
  30. }
  31. ENDCG
  32. }
  33. FallBack "Diffuse"
  34. }