210 lines
9.6 KiB
Plaintext
210 lines
9.6 KiB
Plaintext
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "VFX/VFX_Add_Flow_Sphere"
|
|
{
|
|
Properties
|
|
{
|
|
_MainColor("MainColor", Color) = (1,1,1,1)
|
|
_ColorPower("ColorPower", Float) = 2
|
|
[NoScaleOffset]_MainTex("MainTex", 2D) = "white" {}
|
|
_Vector0("Vector 0", Vector) = (1,1,0,0)
|
|
_Flow_Speed("Flow_Speed", Float) = 0
|
|
_Mask("Mask", 2D) = "white" {}
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
|
|
|
|
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
|
|
LOD 0
|
|
|
|
CGINCLUDE
|
|
#pragma target 3.0
|
|
ENDCG
|
|
Blend One One
|
|
Cull Off
|
|
ColorMask RGBA
|
|
ZWrite Off
|
|
ZTest LEqual
|
|
|
|
|
|
|
|
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"
|
|
#define ASE_NEEDS_FRAG_COLOR
|
|
|
|
|
|
struct appdata
|
|
{
|
|
float4 vertex : POSITION;
|
|
float4 color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
};
|
|
|
|
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
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
float4 ase_color : COLOR;
|
|
};
|
|
|
|
uniform sampler2D _Mask;
|
|
uniform half4 _Mask_ST;
|
|
uniform half _ColorPower;
|
|
uniform half4 _MainColor;
|
|
uniform sampler2D _MainTex;
|
|
uniform half4 _MainTex_ST;
|
|
uniform half4 _Vector0;
|
|
uniform half _Flow_Speed;
|
|
|
|
|
|
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;
|
|
o.ase_color = v.color;
|
|
|
|
//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
|
|
float2 uv_Mask = i.ase_texcoord1.xy * _Mask_ST.xy + _Mask_ST.zw;
|
|
half2 uv0_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
|
|
half2 temp_output_14_0 = (uv0_MainTex*2.0 + -1.0);
|
|
half2 break15 = temp_output_14_0;
|
|
half2 appendResult20 = (half2(length( temp_output_14_0 ) , ( ( atan2( break15.y , break15.x ) / ( 2.0 * UNITY_PI ) ) + 0.5 )));
|
|
half2 appendResult23 = (half2(_Vector0.x , _Vector0.y));
|
|
half mulTime27 = _Time.y * _Flow_Speed;
|
|
half2 appendResult25 = (half2(( _Vector0.z + ( 1.0 - mulTime27 ) ) , _Vector0.w));
|
|
half4 tex2DNode2 = tex2D( _MainTex, (appendResult20*appendResult23 + appendResult25) );
|
|
|
|
|
|
finalColor = ( tex2D( _Mask, uv_Mask ) * ( ( _ColorPower * _MainColor ) * tex2DNode2 * i.ase_color * ( _MainColor.a * tex2DNode2.a * i.ase_color.a ) ) );
|
|
return finalColor;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
CustomEditor "ASEMaterialInspector"
|
|
|
|
|
|
}
|
|
/*ASEBEGIN
|
|
Version=18100
|
|
2567;1;2546;1370;2521.98;1365.12;2.114681;True;True
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;6;-2312,-194;Inherit;True;0;2;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ScaleAndOffsetNode;14;-2037,-189;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT;2;False;2;FLOAT;-1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;29;-1158.474,647.6036;Half;False;Property;_Flow_Speed;Flow_Speed;4;0;Create;True;0;0;False;0;False;0;1;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.BreakToComponentsNode;15;-1599.581,59.71796;Inherit;False;FLOAT2;1;0;FLOAT2;0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
|
|
Node;AmplifyShaderEditor.SimpleTimeNode;27;-924.511,652.4144;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.PiNode;32;-1289.566,321.024;Inherit;False;1;0;FLOAT;2;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ATan2OpNode;16;-1311.581,55.71796;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector4Node;21;-955.2523,430.6756;Half;False;Property;_Vector0;Vector 0;3;0;Create;True;0;0;False;0;False;1,1,0,0;1,1,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.OneMinusNode;31;-726.3655,652.7133;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleDivideOpNode;18;-1007.522,148.7814;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;19;-759.9556,150.0555;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0.5;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;30;-513.7623,628.3817;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.LengthOpNode;13;-1807.262,-188.5737;Inherit;True;1;0;FLOAT2;0,0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;25;-317.7346,581.3172;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;20;-539.4299,-66.68649;Inherit;True;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;23;-499.0076,304.0094;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.ScaleAndOffsetNode;24;-264.5182,-4.721695;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;1,0;False;2;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;39;-5.020996,-526.6621;Half;False;Property;_ColorPower;ColorPower;1;0;Create;True;0;0;False;0;False;2;2;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;1;-18.29471,-362.3501;Half;False;Property;_MainColor;MainColor;0;0;Create;True;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;2;-30.24038,216.6755;Inherit;True;Property;_MainTex;MainTex;2;1;[NoScaleOffset];Create;True;0;0;False;0;False;-1;None;2a11d8f6b279be943a28c8a6f216e792;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.VertexColorNode;5;76.6595,20.13176;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;12;513.7012,71.93274;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;40;235.979,-424.6621;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;725.6283,-162.427;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SamplerNode;38;585.8763,-539.1837;Inherit;True;Property;_Mask;Mask;5;0;Create;True;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;36;992.1169,-350.7314;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.PiNode;17;402.0189,402.5138;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;1340.25,-128.1366;Half;False;True;-1;2;ASEMaterialInspector;0;1;VFX/VFX_Add_Flow_Sphere;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;4;1;False;-1;1;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;True;False;True;2;False;-1;True;True;True;True;True;0;False;-1;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;2;False;-1;True;3;False;-1;True;False;0;False;-1;0;False;-1;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;0;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;;0
|
|
WireConnection;14;0;6;0
|
|
WireConnection;15;0;14;0
|
|
WireConnection;27;0;29;0
|
|
WireConnection;16;0;15;1
|
|
WireConnection;16;1;15;0
|
|
WireConnection;31;0;27;0
|
|
WireConnection;18;0;16;0
|
|
WireConnection;18;1;32;0
|
|
WireConnection;19;0;18;0
|
|
WireConnection;30;0;21;3
|
|
WireConnection;30;1;31;0
|
|
WireConnection;13;0;14;0
|
|
WireConnection;25;0;30;0
|
|
WireConnection;25;1;21;4
|
|
WireConnection;20;0;13;0
|
|
WireConnection;20;1;19;0
|
|
WireConnection;23;0;21;1
|
|
WireConnection;23;1;21;2
|
|
WireConnection;24;0;20;0
|
|
WireConnection;24;1;23;0
|
|
WireConnection;24;2;25;0
|
|
WireConnection;2;1;24;0
|
|
WireConnection;12;0;1;4
|
|
WireConnection;12;1;2;4
|
|
WireConnection;12;2;5;4
|
|
WireConnection;40;0;39;0
|
|
WireConnection;40;1;1;0
|
|
WireConnection;3;0;40;0
|
|
WireConnection;3;1;2;0
|
|
WireConnection;3;2;5;0
|
|
WireConnection;3;3;12;0
|
|
WireConnection;36;0;38;0
|
|
WireConnection;36;1;3;0
|
|
WireConnection;0;0;36;0
|
|
ASEEND*/
|
|
//CHKSM=76488BD0B9FE131C706F11D6E338EAAF0074FA53 |