RBG.shader 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Shader "Rokid/RBG" {
  2. Properties {
  3. _MainColor ("MainColor", Color) = (1.0,1.0,1.0,1.0)
  4. _Color ("Color", Color) = (1.0,1.0,1.0,1.0)
  5. _MainTex("_MainTex", 2D) = "white" {}
  6. _RimPow ("Rim Power", Range(0.0,5.0)) = 2.0
  7. _AddRimPow ("AddRim Power", Range(0.0,5.0)) = 2.0
  8. _Glossiness ("Brightness",Range(0.0,3.0)) = 3.0
  9. }
  10. SubShader {
  11. Tags { "RenderType" = "Transparent" "Queue"="Transparent" "IgnoreProjector"="True"}
  12. Pass {
  13. ZWrite On
  14. ColorMask 0
  15. }
  16. CGPROGRAM
  17. #pragma surface surf Lambert alpha noambient nolightmap nodirlightmap novertexlights
  18. struct Input {
  19. float2 uv_MainTex;
  20. float2 uv_BumpMap;
  21. float2 viewDir;
  22. };
  23. sampler2D _MainTex;
  24. sampler2D _BumpMap;
  25. float4 _MainColor;
  26. float4 _Color;
  27. float _RimPow;
  28. float _AddRimPow;
  29. float _Glossiness;
  30. void surf (Input IN, inout SurfaceOutput o) {
  31. half4 c = tex2D(_MainTex, IN.uv_MainTex)*_MainColor*_AddRimPow;
  32. o.Albedo = c.rgb;
  33. o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
  34. o.Emission = saturate(_Color.rgb * pow((1.0 - saturate(dot (normalize(IN.viewDir), o.Normal))), _RimPow) * _Glossiness + c);
  35. o.Alpha = c.a * _Glossiness * o.Emission;
  36. }
  37. ENDCG
  38. }
  39. Fallback "Diffuse"
  40. }