ReflectiveDiffuseSpec.shader 1013 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Shader "Reflective/Diffuse Reflection Spec" {
  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 200
  12. Tags { "RenderType"="Opaque" }
  13. CGPROGRAM
  14. #pragma surface surf BlinnPhong
  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.Specular = _Shininess;
  32. o.Emission = reflcol.rgb * _ReflectColor.rgb * tex.a;
  33. }
  34. ENDCG
  35. }
  36. FallBack "Reflective/VertexLit"
  37. }