DiffuseReflectiveShader.shader 862 B

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