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/AlphaHuXiBase.shader

167 lines
7.0 KiB

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "AlphaHuXiBase"
{
Properties
{
_Speed("Speed", Range( 0 , 2)) = 1
_ColorIndex("ColorIndex", Int) = 0
_MinAlpha("MinAlpha", Float) = 0.5
[HDR]_MaxAlpha("MaxAlpha", Float) = 1
}
SubShader
{
Tags { "RenderType"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend One Zero, SrcAlpha OneMinusSrcAlpha
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;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 worldPos : TEXCOORD0;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
uniform int _ColorIndex;
uniform half _MinAlpha;
uniform half _MaxAlpha;
uniform half _Speed;
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
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
half4 color28 = IsGammaSpace() ? half4(1.304119,0.3225894,0.266286,1) : half4(1.793486,0.08492619,0.05764138,1);
half4 color3 = IsGammaSpace() ? half4(1.304119,1.201701,0.2662861,1) : half4(1.793486,1.498139,0.05764144,1);
half4 color29 = IsGammaSpace() ? half4(0.5530557,1.304119,0.2321468,1) : half4(0.2664761,1.793486,0.04401935,1);
half mulTime6 = _Time.y * _Speed;
half temp_output_18_0 = abs( sin( mulTime6 ) );
half smoothstepResult31 = smoothstep( _MinAlpha , _MaxAlpha , temp_output_18_0);
finalColor = ( ( (float)_ColorIndex - 0.0 > (float)1 ? color28 : (float)_ColorIndex - 0.0 <= (float)1 && (float)_ColorIndex + 0.0 >= (float)1 ? color3 : color29 ) * smoothstepResult31 );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
Fallback "Unlit/Color"
}
/*ASEBEGIN
Version=18900
88;172;1253;631;1307.825;-129.9178;1;True;True
Node;AmplifyShaderEditor.RangedFloatNode;12;-1574.224,263.5381;Inherit;False;Property;_Speed;Speed;0;0;Create;True;0;0;0;False;0;False;1;0.51;0;2;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleTimeNode;6;-1216.446,196.771;Inherit;True;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SinOpNode;30;-1015.355,214.097;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;28;-1121.418,-367.9857;Inherit;False;Constant;_TintColor1;TintColor;1;1;[HDR];Create;True;0;0;0;False;0;False;1.304119,0.3225894,0.266286,1;0.2858358,1.39772,0.2707624,0.8352941;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.ColorNode;29;-1115.838,-15.64137;Inherit;False;Constant;_TintColor2;TintColor;1;1;[HDR];Create;True;0;0;0;False;0;False;0.5530557,1.304119,0.2321468,1;0.2858358,1.39772,0.2707624,0.8352941;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.ColorNode;3;-1114.306,-189.6386;Inherit;False;Constant;_TintColor;TintColor;1;1;[HDR];Create;True;0;0;0;False;0;False;1.304119,1.201701,0.2662861,1;0.2858358,1.39772,0.2707624,0.8352941;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.IntNode;26;-1110.86,-625.0836;Inherit;False;Constant;_Int1;Int 1;3;0;Create;True;0;0;0;False;0;False;1;0;False;0;1;INT;0
Node;AmplifyShaderEditor.IntNode;24;-898.3265,-832.2639;Inherit;False;Property;_ColorIndex;ColorIndex;1;0;Create;True;0;0;0;False;0;False;0;0;False;0;1;INT;0
Node;AmplifyShaderEditor.AbsOpNode;18;-825.6699,185.173;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;10;-828.0668,439.4967;Inherit;False;Property;_MinAlpha;MinAlpha;2;0;Create;True;0;0;0;False;0;False;0.5;-0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;11;-826.647,510.8691;Inherit;False;Property;_MaxAlpha;MaxAlpha;3;1;[HDR];Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TFHCIf;25;-756.352,-245.5659;Inherit;False;6;0;INT;0;False;1;INT;0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SmoothstepOpNode;31;-589.9502,154.2283;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-106.3295,-5.02082;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ClampOpNode;9;-494.7867,323.4244;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;161.1177,-41.91241;Half;False;True;-1;2;ASEMaterialInspector;100;1;AlphaHuXiBase;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;0;5;False;-1;10;False;-1;2;5;False;-1;10;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;True;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;Unlit/Color;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;False;0
WireConnection;6;0;12;0
WireConnection;30;0;6;0
WireConnection;18;0;30;0
WireConnection;25;0;24;0
WireConnection;25;1;26;0
WireConnection;25;2;28;0
WireConnection;25;3;3;0
WireConnection;25;4;29;0
WireConnection;31;0;18;0
WireConnection;31;1;10;0
WireConnection;31;2;11;0
WireConnection;19;0;25;0
WireConnection;19;1;31;0
WireConnection;9;0;18;0
WireConnection;9;1;10;0
WireConnection;9;2;11;0
WireConnection;0;0;19;0
ASEEND*/
//CHKSM=D6F4293D858096613642169E78010F5919E039B8