TestUI.shader 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Shader "Hog's shaders/BumpSpec_Twoside2" {
  2. Properties{
  3. _Color("Main Color", Color) = (1,1,1,1)
  4. _SpecColor("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
  5. _Shininess("Shininess", Range(0.03, 1)) = 0.078125
  6. _MainTex("Base (RGB) Gloss (A)", 2D) = "white" {}
  7. _BumpMap("Normalmap", 2D) = "bump" {}
  8. _BackColor("Back Main Color", Color) = (1,1,1,1)
  9. _BackMainTex("Back Base (RGB) Gloss (A)", 2D) = "white" {}
  10. }
  11. SubShader{
  12. Tags { "RenderType" = "Opaque" }
  13. LOD 400
  14. Cull back
  15. CGPROGRAM
  16. #pragma surface surf BlinnPhong
  17. sampler2D _MainTex;
  18. sampler2D _BumpMap;
  19. fixed4 _Color;
  20. half _Shininess;
  21. struct Input {
  22. float2 uv_MainTex;
  23. float2 uv_BumpMap;
  24. };
  25. void surf(Input IN, inout SurfaceOutput o) {
  26. fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
  27. o.Albedo = tex.rgb * _Color.rgb;
  28. o.Gloss = tex.a;
  29. o.Alpha = tex.a * _Color.a;
  30. o.Specular = _Shininess;
  31. o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
  32. }
  33. ENDCG
  34. Cull front
  35. CGPROGRAM
  36. #pragma surface surf Lambert
  37. sampler2D _BackMainTex;
  38. fixed4 _BackColor;
  39. struct Input {
  40. float2 uv_BackMainTex;
  41. };
  42. void surf(Input IN, inout SurfaceOutput o) {
  43. fixed4 c = tex2D(_BackMainTex, IN.uv_BackMainTex) * _BackColor;
  44. o.Albedo = c.rgb;
  45. o.Alpha = c.a;
  46. }
  47. ENDCG
  48. }
  49. FallBack "Specular"
  50. }