Shader "engine"
{
Properties
{
_color("_color", 2D) = "white" {}
_UVOffset("_UVOffset", 2D) = "white" {}
_speed("_speed", Float) = 1
_pow("_pow", Float) = 2
_force("_force", Float) = 1
_UVOffsetscale("_UVOffsetscale", Range(0,0.5) ) = 0.1163522
_add_color("_add_color", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent+2"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
GrabPass { }
Cull Back
ZWrite Off
ZTest LEqual
CGPROGRAM
#pragma surface surf BlinnPhongEditor alpha vertex:vert
#pragma target 3.0
struct EditorSurfaceOutput {
half3 Albedo;
half3 Normal;
half3 Emission;
half3 Gloss;
half Specular;
half Alpha;
};
inline half4 LightingBlinnPhongEditor (EditorSurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
{
#ifndef USING_DIRECTIONAL_LIGHT
lightDir = normalize(lightDir);
#endif
viewDir = normalize(viewDir);
half3 h = normalize (lightDir + viewDir);
half diff = max (0, dot (s.Normal, lightDir));
float nh = max (0, dot (s.Normal, h));
float3 spec = pow (nh, s.Specular*128.0) * s.Gloss;
half4 c;
c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * spec) * (atten * 2);
c.a = s.Alpha + _LightColor0.a * Luminance(spec) * atten;
return c;
}
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 + Luminance(spec);
return c;
}
struct Input {
float2 uv_color;
float2 uv_UVOffset;
float3 viewDir;
float4 screenPos;
float2 uv_add_color;
};
void vert (inout appdata_full v, out Input o) {
}
sampler2D _color;
sampler2D _UVOffset;
float _speed;
float _pow;
float _force;
sampler2D _GrabTexture;
float _UVOffsetscale;
sampler2D _add_color;
void surf (Input IN, inout EditorSurfaceOutput o) {
o.Albedo = 0.0;
o.Normal = float3(0.0,0.0,1.0);
o.Emission = 0.0;
o.Gloss = 0.0;
o.Specular = 0.0;
o.Alpha = 1.0;
float4 Multiply2=_Time * float4(_speed);
float4 UV_Pan0=float4((IN.uv_UVOffset.xyxy).x,(IN.uv_UVOffset.xyxy).y + Multiply2.x,(IN.uv_UVOffset.xyxy).z,(IN.uv_UVOffset.xyxy).w);
float4 Tex2D2=tex2D(_color,UV_Pan0.xy);
float4 Fresnel0_1_NoInput = float4(0,0,1,1);
float4 Fresnel0=float4( 1.0 - dot( normalize( float4(IN.viewDir, 1.0).xyz), normalize( Fresnel0_1_NoInput.xyz ) ) );
float4 Subtract0=float4( 1.0 ) - Fresnel0;
float4 Pow0=pow(Subtract0,float4(_pow));
float4 Tex2D3=tex2D(_color,(IN.uv_color.xyxy).xy);
float4 Multiply0=Pow0 * float4( Tex2D3.a);
float4 Multiply3=Multiply0 * float4(_force);
float4 Pow1=pow(Multiply3,float4( 2));
float4 Multiply4=Tex2D2 * Pow1;
float4 Tex2D1=tex2D(_UVOffset,UV_Pan0.xy);
float4 Subtract1=float4( 0.5,0.5,0.5,0) - Tex2D1;
float4 Multiply1=_UVOffsetscale.xxxx * Subtract1;
float4 Add0=((IN.screenPos.xy/IN.screenPos.w).xyxy) + Multiply1;
float4 Tex2D0=tex2D(_GrabTexture,Add0.xy);
float4 Add1=Multiply4 + Tex2D0;
float4 Tex2D4=tex2D(_add_color,(IN.uv_add_color.xyxy).xy);
float4 Add2=Add1 + Tex2D4;
float4 Master0_0_NoInput = float4(0,0,0,0);
float4 Master0_1_NoInput = float4(0,0,1,1);
float4 Master0_3_NoInput = float4(0,0,0,0);
float4 Master0_4_NoInput = float4(0,0,0,0);
float4 Master0_6_NoInput = float4(1,1,1,1);
o.Normal = float3( 0.0, 0.0, 1.0);
o.Emission = Add2;
o.Alpha = Multiply3;
}
ENDCG
}
Fallback "Diffuse"
}