You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TrafficSafe/Assets/Mat/Shader/AlphaHuXiCell_2.shader

246 lines
12 KiB

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "AlphaHuXiCell"
{
Properties
{
[HDR]_TintColor("TintColor", Color) = (1,1,1,0.7294118)
_Speed("Speed", Range( 0 , 2)) = 1
_TexScale("TexScale", Range( 0 , 0.8)) = 0.66
_Float0("Float 0", Range( 0 , 0.8)) = 0.66
_MinAlpha("MinAlpha", Range( 0 , 1)) = 0.5
_MaxAlpha("MaxAlpha", Range( 0 , 0.8)) = 0.8
_TilingScale("TilingScale", Range( 0 , 100)) = 8
}
SubShader
{
Tags { "RenderType"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend Off
AlphaToMask On
Cull Back
ColorMask RGBA
ZWrite On
ZTest LEqual
Offset 0 , 0
Pass
{
Name "Unlit"
Tags { "LightMode"="ForwardBase" }
CGPROGRAM
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
//only defining to not throw compilation error over Unity 5.5
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
#include "UnityShaderVariables.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 worldPos : TEXCOORD0;
#endif
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
uniform half _TilingScale;
uniform half _TexScale;
uniform half _Float0;
uniform half4 _TintColor;
uniform half _Speed;
uniform half _MinAlpha;
uniform half _MaxAlpha;
float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
float snoise( float2 v )
{
const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
float2 i = floor( v + dot( v, C.yy ) );
float2 x0 = v - i + dot( i, C.xx );
float2 i1;
i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
float4 x12 = x0.xyxy + C.xxzz;
x12.xy -= i1;
i = mod2D289( i );
float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
m = m * m;
m = m * m;
float3 x = 2.0 * frac( p * C.www ) - 1.0;
float3 h = abs( x ) - 0.5;
float3 ox = floor( x + 0.5 );
float3 a0 = x - ox;
m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
float3 g;
g.x = a0.x * x0.x + h.x * x0.y;
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
return 130.0 * dot( m, g );
}
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.ase_texcoord1.xy = v.ase_texcoord.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
float3 vertexValue = float3(0, 0, 0);
#if ASE_ABSOLUTE_VERTEX_POS
vertexValue = v.vertex.xyz;
#endif
vertexValue = vertexValue;
#if ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
o.vertex = UnityObjectToClipPos(v.vertex);
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
#endif
return o;
}
fixed4 frag (v2f i ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
fixed4 finalColor;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 WorldPosition = i.worldPos;
#endif
half2 break19_g9 = half2( -0.2,0.5 );
half2 temp_cast_0 = (_TilingScale).xx;
half2 temp_output_40_0 = ( 1.0 - abs( ( _Time.y * half2( 0,-1 ) ) ) );
half temp_output_2_0_g7 = _TexScale;
half2 appendResult10_g8 = (half2(temp_output_2_0_g7 , temp_output_2_0_g7));
half2 temp_output_11_0_g8 = ( abs( (frac( (i.ase_texcoord1.xy*temp_cast_0 + temp_output_40_0) )*2.0 + -1.0) ) - appendResult10_g8 );
half2 break16_g8 = ( 1.0 - ( temp_output_11_0_g8 / fwidth( temp_output_11_0_g8 ) ) );
half2 temp_cast_1 = (_TilingScale).xx;
half temp_output_2_0_g5 = ( _Float0 - 0.05 );
half2 appendResult10_g6 = (half2(temp_output_2_0_g5 , temp_output_2_0_g5));
half2 temp_output_11_0_g6 = ( abs( (frac( (i.ase_texcoord1.xy*temp_cast_1 + temp_output_40_0) )*2.0 + -1.0) ) - appendResult10_g6 );
half2 break16_g6 = ( 1.0 - ( temp_output_11_0_g6 / fwidth( temp_output_11_0_g6 ) ) );
half temp_output_55_0 = ( saturate( min( break16_g8.x , break16_g8.y ) ) - saturate( min( break16_g6.x , break16_g6.y ) ) );
half2 temp_cast_2 = (temp_output_55_0).xx;
half simplePerlin2D21 = snoise( temp_cast_2*1.3 );
simplePerlin2D21 = simplePerlin2D21*0.5 + 0.5;
half temp_output_1_0_g9 = simplePerlin2D21;
half sinIn7_g9 = sin( temp_output_1_0_g9 );
half sinInOffset6_g9 = sin( ( temp_output_1_0_g9 + 1.0 ) );
half lerpResult20_g9 = lerp( break19_g9.x , break19_g9.y , frac( ( sin( ( ( sinIn7_g9 - sinInOffset6_g9 ) * 91.2228 ) ) * 43758.55 ) ));
half mulTime6 = _Time.y * _Speed;
half clampResult59 = clamp( abs( sin( mulTime6 ) ) , _MinAlpha , _MaxAlpha );
finalColor = ( ( ( lerpResult20_g9 + sinIn7_g9 ) * _TintColor ) * clampResult59 );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18900
63.2;61.6;1253;740;966.0887;471.9883;1.513119;True;True
Node;AmplifyShaderEditor.Vector2Node;34;-3973.253,-306.7622;Inherit;False;Constant;_Vector0;Vector 0;2;0;Create;True;0;0;0;False;0;False;0,-1;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.SimpleTimeNode;27;-4200.862,-547.5765;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;35;-3682.055,-502.4601;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.AbsOpNode;36;-3411.707,-536.0048;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.RangedFloatNode;54;-3279.042,335.6874;Inherit;False;Constant;_Float4;Float 4;7;0;Create;True;0;0;0;False;0;False;0.05;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;52;-3417.098,26.66421;Inherit;False;Property;_Float0;Float 0;3;0;Create;True;0;0;0;False;0;False;0.66;0.41;0;0.8;0;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;40;-3128.237,-483.4884;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.RangedFloatNode;29;-3084.928,-1114.501;Inherit;False;Property;_TexScale;TexScale;2;0;Create;True;0;0;0;False;0;False;0.66;1;0;0.8;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;53;-3099.855,131.7848;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;42;-3182.504,-764.3279;Inherit;False;Property;_TilingScale;TilingScale;6;0;Create;True;0;0;0;False;0;False;8;43;0;100;0;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;46;-2632.556,-224.8241;Inherit;False;Grid;-1;;5;a9240ca2be7e49e4f9fa3de380c0dbe9;0;3;5;FLOAT2;8,8;False;6;FLOAT2;0,0;False;2;FLOAT;0.9;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;12;-1606.371,420.7017;Inherit;False;Property;_Speed;Speed;1;0;Create;True;0;0;0;False;0;False;1;0.41;0;2;0;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;30;-2601.583,-602.4348;Inherit;False;Grid;-1;;7;a9240ca2be7e49e4f9fa3de380c0dbe9;0;3;5;FLOAT2;8,8;False;6;FLOAT2;0,0;False;2;FLOAT;0.9;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleTimeNode;6;-1248.593,353.9346;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;55;-2172.667,-341.1604;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;43;-1273.093,-38.53386;Inherit;False;Constant;_Float3;Float 3;5;0;Create;True;0;0;0;False;0;False;1.3;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.NoiseGeneratorNode;21;-1184.857,-309.1437;Inherit;False;Simplex2D;True;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SinOpNode;56;-954.9856,367.2709;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;60;-1050.473,-70.0834;Inherit;False;Constant;_Vector1;Vector 1;7;0;Create;True;0;0;0;False;0;False;-0.2,0.5;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.RangedFloatNode;10;-1068.571,619.0865;Inherit;False;Property;_MinAlpha;MinAlpha;4;0;Create;True;0;0;0;False;0;False;0.5;0.7;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.AbsOpNode;18;-752.7521,360.3176;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;45;-785.5416,648.8485;Inherit;False;Property;_MaxAlpha;MaxAlpha;5;0;Create;True;0;0;0;False;0;False;0.8;0.8;0;0.8;0;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;44;-849.9824,-323.562;Inherit;False;Noise Sine Wave;-1;;9;a6eff29f739ced848846e3b648af87bd;0;2;1;FLOAT;0;False;2;FLOAT2;-0.5,0.5;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;3;-847.1637,-21.83372;Inherit;False;Property;_TintColor;TintColor;0;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,0.7294118;0.4346614,0.5278031,1.976675,0.7176471;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;2;-479.6482,-205.4569;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ClampOpNode;59;-388.0531,411.1905;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;41;-1647.771,-130.3231;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-270.4236,28.54218;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;161.1177,-41.91241;Half;False;True;-1;2;ASEMaterialInspector;100;1;AlphaHuXiCell;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;0;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;RenderType=Transparent=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;False;0
WireConnection;35;0;27;0
WireConnection;35;1;34;0
WireConnection;36;0;35;0
WireConnection;40;0;36;0
WireConnection;53;0;52;0
WireConnection;53;1;54;0
WireConnection;46;5;42;0
WireConnection;46;6;40;0
WireConnection;46;2;53;0
WireConnection;30;5;42;0
WireConnection;30;6;40;0
WireConnection;30;2;29;0
WireConnection;6;0;12;0
WireConnection;55;0;30;0
WireConnection;55;1;46;0
WireConnection;21;0;55;0
WireConnection;21;1;43;0
WireConnection;56;0;6;0
WireConnection;18;0;56;0
WireConnection;44;1;21;0
WireConnection;44;2;60;0
WireConnection;2;0;44;0
WireConnection;2;1;3;0
WireConnection;59;0;18;0
WireConnection;59;1;10;0
WireConnection;59;2;45;0
WireConnection;41;0;55;0
WireConnection;19;0;2;0
WireConnection;19;1;59;0
WireConnection;0;0;19;0
ASEEND*/
//CHKSM=E9C319A8ED65A699F9301E96E3B540B0F12968F0