今天我们来看一下unity透明双面shader。
  1. Shader "Glow 11/Unity/Transparent/Diffuse"
  2. {
  3. Properties {
  4. _Color ("Main Color", Color) = (1,1,1,1)
  5. _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  6. _GlowTex ("Glow", 2D) = "" {}
  7. _GlowColor ("Glow Color", Color)  = (1,1,1,1)
  8. _GlowStrength ("Glow Strength", Float) = 1.0
  9. }
  10. SubShader {
  11. Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderEffect"="Glow11Transparent" "RenderType"="Glow11Transparent" }
  12. LOD 200
  13. CGPROGRAM
  14. #pragma surface surf Lambert alpha
  15. sampler2D _MainTex;
  16. fixed4 _Color;
  17. struct Input {
  18. float2 uv_MainTex;
  19. };
  20. void surf (Input IN, inout SurfaceOutput o)
  21. {
  22. fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
  23. o.Albedo = c.rgb;
  24. o.Alpha = c.a;
  25. }
  26. ENDCG
  27. }
  28. FallBack "Glow 11/Unity/Transparent/VertexLit"
  29. CustomEditor "GlowMatInspector"
  30. }