ReflectiveDiffuseSpecTransp.shader 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Shader "Reflective/Diffuse Reflection Spec Transp" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0)
  5. _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
  6. _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
  7. _MainTex ("Base (RGB) RefStrength+Gloss (A)", 2D) = "white" {}
  8. _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect }
  9. }
  10. SubShader {
  11. LOD 300
  12. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transperant" }
  13. CGPROGRAM
  14. #pragma surface surf BlinnPhong alpha
  15. sampler2D _MainTex;
  16. samplerCUBE _Cube;
  17. fixed4 _Color;
  18. fixed4 _ReflectColor;
  19. half _Shininess;
  20. struct Input {
  21. float2 uv_MainTex;
  22. float3 worldRefl;
  23. };
  24. void surf (Input IN, inout SurfaceOutput o) {
  25. fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
  26. fixed4 c = tex * _Color;
  27. o.Albedo = c.rgb;
  28. o.Gloss = tex.a;
  29. fixed4 reflcol = texCUBE (_Cube, IN.worldRefl);
  30. reflcol *= tex.a;
  31. o.Alpha = _Color.a;
  32. o.Specular = _Shininess;
  33. o.Emission = reflcol.rgb * _ReflectColor.rgb * tex.a;
  34. }
  35. ENDCG
  36. }
  37. FallBack "Reflective/VertexLit"
  38. }