
Shader "Util's Shader/Water/Water Real"
{
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
_SpecColor("Specular Color", Color) = (1,1,1,1)
_Shininess("Shininess", Range(0.01,5) ) = 0.01
_MainTex("Base (RGB) Gloss (A)", 2D) = "white" {}
_BumpMap("Normalmap", 2D) = "bump" {}
_RefractionColor("Refraction Color", Color ) = (1,1,1,1)
_RefractionDis("Refraction Distortion", Range(0,1) ) = 1
_ReflectColor("Reflection Color", Color) = (1,1,1,1)
_ReflectionDis("Reflection Distortion", Range(0,1) ) = 1
_ReflectionTex("Reflection Texture", 2D) = "black" {}
_Fresnel("Fresnel", Range(0,1) ) = 0
_WaveSpeed("Wave speed (map1 x,y; map2 x,y)", Vector) = (0.2,0.2,1,0)
}
SubShader
{
GrabPass {
Name "BASE"
Tags { "LightMode" = "Always" }
}
Tags { "Queue"="Transparent" "IgnoreProjector"="False" "RenderType"="Opaque" }
Cull Back
Lighting Off
CGPROGRAM
#pragma surface surf BlinnPhongGlass dualforward
#pragma target 3.0
inline fixed4 LightingBlinnPhongGlass ( inout SurfaceOutput s, fixed3 lightDir, half3 viewDir, fixed atten)
{
half3 h = normalize (lightDir + viewDir);
fixed diff = max (0, dot (s.Normal*2, lightDir));
float nh = max (0, dot (s.Normal, h));
float spec = pow (nh, s.Specular*128.0) * s.Gloss;
fixed4 c;
c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * _SpecColor.rgb * spec) * (atten * 2);
c.a = s.Alpha + _LightColor0.a * _SpecColor.a * spec * atten;
s.Alpha = s.Alpha + c.a + c.rgb;
return c;
}
sampler2D _GrabTexture;
fixed4 _Color;
half _Shininess;
sampler2D _MainTex;
sampler2D _BumpMap;
fixed4 _ReflectColor;
sampler2D _ReflectionTex;
half _ReflectionDis;
fixed4 _RefractionColor;
half _RefractionDis;
half _Fresnel;
float4 _WaveSpeed;
struct Input {
float2 uv_MainTex;