| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- Shader "Reflective/Diffuse Reflection Spec Transp" {
- Properties {
- _Color ("Main Color", Color) = (1,1,1,1)
- _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0)
- _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
- _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
- _MainTex ("Base (RGB) RefStrength+Gloss (A)", 2D) = "white" {}
- _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect }
- }
- SubShader {
- LOD 300
- Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transperant" }
-
- CGPROGRAM
- #pragma surface surf BlinnPhong alpha
- sampler2D _MainTex;
- samplerCUBE _Cube;
- fixed4 _Color;
- fixed4 _ReflectColor;
- half _Shininess;
- struct Input {
- float2 uv_MainTex;
- float3 worldRefl;
- };
- void surf (Input IN, inout SurfaceOutput o) {
- fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
- fixed4 c = tex * _Color;
- o.Albedo = c.rgb;
- o.Gloss = tex.a;
- fixed4 reflcol = texCUBE (_Cube, IN.worldRefl);
- reflcol *= tex.a;
- o.Alpha = _Color.a;
- o.Specular = _Shininess;
- o.Emission = reflcol.rgb * _ReflectColor.rgb * tex.a;
-
- }
- ENDCG
- }
-
- FallBack "Reflective/VertexLit"
- }
|