Скрытый текст:
Shader "NewOcean_optymized 1"
{
Properties
{
_Diffuse_Mask("_Diffuse_Mask", 2D) = "black" {}
_BottomTexture("_BottomTexture", 2D) = "black" {}
_Bottom_Color("_Bottom_Color", Color) = (1,1,1,1)
_DeepWaterColor("_DeepWaterColor", Color) = (1,1,1,1)
_Transparency("_Transparency", Range(1,0) ) = 1
_Wave_Normal("_Wave_Normal", 2D) = "bump" {}
_SpecularColor("_SpecularColor", Color) = (1,1,1,1)
_Glossynes("_Glossynes", Range(0.001,1) ) = 0.5
_Speed("_Speed", Range(0.001,0.5) ) = 0.001
_Speed2("_Speed2", Range(0.1,3) ) = 0.5
}
SubShader
{
Tags
{
"Queue"="Geometry"
"IgnoreProjector"="False"
"RenderType"="Opaque"
}
Cull Back
ZWrite On
ZTest LEqual
ColorMask RGBA
Fog{
}
CGPROGRAM
#pragma surface surf BlinnPhongEditor softvegetation noforwardadd approxview vertex:vert
#pragma target 2.0
sampler2D _Diffuse_Mask;
sampler2D _BottomTexture;
float4 _Bottom_Color;
float4 _DeepWaterColor;
float _Transparency;
sampler2D _Wave_Normal;
float4 _SpecularColor;
float _Glossynes;
float _Speed;
float4x4 _Wave1_direction;
float _Speed2;
struct EditorSurfaceOutput {
half3 Albedo;
half3 Normal;
half3 Emission;
half3 Gloss;
half Specular;
half Alpha;
half4 Custom;
};
inline half4 LightingBlinnPhongEditor_PrePass (EditorSurfaceOutput s, half4 light)
{
half3 spec = light.a * s.Gloss;
half4 c;
c.rgb = (s.Albedo * light.rgb + light.rgb * spec);
c.a = s.Alpha;
return c;
}
inline half4 LightingBlinnPhongEditor (EditorSurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
{
half3 h = normalize (lightDir + viewDir);
half diff = max (0, dot ( lightDir, s.Normal ));
float nh = max (0, dot (s.Normal, h));
float spec = pow (nh, s.Specular*128.0);
half4 res;
res.rgb = _LightColor0.rgb * diff;
res.w = spec * Luminance (_LightColor0.rgb);
res *= atten * 2.0;
return LightingBlinnPhongEditor_PrePass( s, res );
}
struct Input {
float2 uv_BottomTexture;
float2 uv_Diffuse_Mask;
float2 uv_Wave_Normal;
};
void vert (inout appdata_full v, out Input o) {
}
void surf (Input IN, inout EditorSurfaceOutput o) {
o.Normal = float3(0.0,0.0,1.0);
o.Alpha = 1.0;
o.Albedo = 0.0;
o.Emission = 0.0;
o.Gloss = 0.0;
o.Specular = 0.0;
o.Custom = 0.0;
float4 Tex2D1=tex2D(_BottomTexture,(IN.uv_BottomTexture.xyxy).xy);
float4 Tex2D0=tex2D(_Diffuse_Mask,(IN.uv_Diffuse_Mask.xyxy).xy);
float4 Multiply2=Tex2D0.aaaa * _Transparency.xxxx;
float4 Invert0= float4(1.0, 1.0, 1.0, 1.0) - Multiply2;
float4 Multiply3=Tex2D1 * Invert0;
float4 Multiply0=_Bottom_Color * Multiply3;
float4 Multiply1=_DeepWaterColor * Tex2D0;
float4 Lerp0=lerp(Multiply0,Multiply1,Multiply2);
float4 VxM0=mul( (IN.uv_Wave_Normal.xyxy), _Wave1_direction );
float4 Tex2DNormal0=float4(UnpackNormal( tex2D(_Wave_Normal,VxM0.xy)).xyz, 1.0 );
float4 Tex2DNormal1=float4(UnpackNormal( tex2D(_Wave_Normal,(IN.uv_Wave_Normal.xyxy).xy)).xyz, 1.0 );
float4 Add2=Tex2DNormal0 + Tex2DNormal1;
float4 Normalize0=normalize(Add2);
float4 Master0_2_NoInput = float4(0,0,0,0);
float4 Master0_5_NoInput = float4(1,1,1,1);
float4 Master0_7_NoInput = float4(0,0,0,0);
float4 Master0_6_NoInput = float4(1,1,1,1);
o.Albedo = Lerp0;
o.Normal = Normalize0;
o.Specular = _Glossynes.xxxx;
o.Gloss = _SpecularColor;
o.Normal = normalize(o.Normal);
}
ENDCG
}
Fallback "Diffuse"
}
{
Properties
{
_Diffuse_Mask("_Diffuse_Mask", 2D) = "black" {}
_BottomTexture("_BottomTexture", 2D) = "black" {}
_Bottom_Color("_Bottom_Color", Color) = (1,1,1,1)
_DeepWaterColor("_DeepWaterColor", Color) = (1,1,1,1)
_Transparency("_Transparency", Range(1,0) ) = 1
_Wave_Normal("_Wave_Normal", 2D) = "bump" {}
_SpecularColor("_SpecularColor", Color) = (1,1,1,1)
_Glossynes("_Glossynes", Range(0.001,1) ) = 0.5
_Speed("_Speed", Range(0.001,0.5) ) = 0.001
_Speed2("_Speed2", Range(0.1,3) ) = 0.5
}
SubShader
{
Tags
{
"Queue"="Geometry"
"IgnoreProjector"="False"
"RenderType"="Opaque"
}
Cull Back
ZWrite On
ZTest LEqual
ColorMask RGBA
Fog{
}
CGPROGRAM
#pragma surface surf BlinnPhongEditor softvegetation noforwardadd approxview vertex:vert
#pragma target 2.0
sampler2D _Diffuse_Mask;
sampler2D _BottomTexture;
float4 _Bottom_Color;
float4 _DeepWaterColor;
float _Transparency;
sampler2D _Wave_Normal;
float4 _SpecularColor;
float _Glossynes;
float _Speed;
float4x4 _Wave1_direction;
float _Speed2;
struct EditorSurfaceOutput {
half3 Albedo;
half3 Normal;
half3 Emission;
half3 Gloss;
half Specular;
half Alpha;
half4 Custom;
};
inline half4 LightingBlinnPhongEditor_PrePass (EditorSurfaceOutput s, half4 light)
{
half3 spec = light.a * s.Gloss;
half4 c;
c.rgb = (s.Albedo * light.rgb + light.rgb * spec);
c.a = s.Alpha;
return c;
}
inline half4 LightingBlinnPhongEditor (EditorSurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
{
half3 h = normalize (lightDir + viewDir);
half diff = max (0, dot ( lightDir, s.Normal ));
float nh = max (0, dot (s.Normal, h));
float spec = pow (nh, s.Specular*128.0);
half4 res;
res.rgb = _LightColor0.rgb * diff;
res.w = spec * Luminance (_LightColor0.rgb);
res *= atten * 2.0;
return LightingBlinnPhongEditor_PrePass( s, res );
}
struct Input {
float2 uv_BottomTexture;
float2 uv_Diffuse_Mask;
float2 uv_Wave_Normal;
};
void vert (inout appdata_full v, out Input o) {
}
void surf (Input IN, inout EditorSurfaceOutput o) {
o.Normal = float3(0.0,0.0,1.0);
o.Alpha = 1.0;
o.Albedo = 0.0;
o.Emission = 0.0;
o.Gloss = 0.0;
o.Specular = 0.0;
o.Custom = 0.0;
float4 Tex2D1=tex2D(_BottomTexture,(IN.uv_BottomTexture.xyxy).xy);
float4 Tex2D0=tex2D(_Diffuse_Mask,(IN.uv_Diffuse_Mask.xyxy).xy);
float4 Multiply2=Tex2D0.aaaa * _Transparency.xxxx;
float4 Invert0= float4(1.0, 1.0, 1.0, 1.0) - Multiply2;
float4 Multiply3=Tex2D1 * Invert0;
float4 Multiply0=_Bottom_Color * Multiply3;
float4 Multiply1=_DeepWaterColor * Tex2D0;
float4 Lerp0=lerp(Multiply0,Multiply1,Multiply2);
float4 VxM0=mul( (IN.uv_Wave_Normal.xyxy), _Wave1_direction );
float4 Tex2DNormal0=float4(UnpackNormal( tex2D(_Wave_Normal,VxM0.xy)).xyz, 1.0 );
float4 Tex2DNormal1=float4(UnpackNormal( tex2D(_Wave_Normal,(IN.uv_Wave_Normal.xyxy).xy)).xyz, 1.0 );
float4 Add2=Tex2DNormal0 + Tex2DNormal1;
float4 Normalize0=normalize(Add2);
float4 Master0_2_NoInput = float4(0,0,0,0);
float4 Master0_5_NoInput = float4(1,1,1,1);
float4 Master0_7_NoInput = float4(0,0,0,0);
float4 Master0_6_NoInput = float4(1,1,1,1);
o.Albedo = Lerp0;
o.Normal = Normalize0;
o.Specular = _Glossynes.xxxx;
o.Gloss = _SpecularColor;
o.Normal = normalize(o.Normal);
}
ENDCG
}
Fallback "Diffuse"
}