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.
241 lines
12 KiB
241 lines
12 KiB
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "AlphaHuXiCell1"
|
|
{
|
|
Properties
|
|
{
|
|
_Speed("Speed", Range( 0 , 2)) = 1
|
|
_MinAlpha("MinAlpha", Range( 0 , 1)) = 0.5
|
|
_MaxAlpha("MaxAlpha", Range( 0 , 1)) = 1
|
|
_TextureSample0("Texture Sample 0", 2D) = "white" {}
|
|
_RollSpeed("RollSpeed", Range( 0 , 1)) = 0
|
|
_TexScale("TexScale", Range( 0 , 100)) = 0
|
|
[HDR]_TintColor("TintColor", Color) = (0,0,0,0)
|
|
|
|
}
|
|
|
|
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 sampler2D _TextureSample0;
|
|
uniform float _TexScale;
|
|
uniform float _RollSpeed;
|
|
uniform float4 _TintColor;
|
|
uniform float _Speed;
|
|
uniform float _MinAlpha;
|
|
uniform float _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
|
|
float2 break19_g1 = float2( -0.3,0.5 );
|
|
float mulTime57 = _Time.y * _RollSpeed;
|
|
float2 texCoord55 = i.ase_texcoord1.xy * ( _TexScale * float2( 24,20 ) ) + ( mulTime57 * float2( 0,-1 ) );
|
|
float cos75 = cos( ( abs( _SinTime.y ) * 0.01 ) );
|
|
float sin75 = sin( ( abs( _SinTime.y ) * 0.01 ) );
|
|
float2 rotator75 = mul( texCoord55 - float2( -1,1 ) , float2x2( cos75 , -sin75 , sin75 , cos75 )) + float2( -1,1 );
|
|
float2 temp_cast_0 = (tex2D( _TextureSample0, rotator75 ).a).xx;
|
|
float simplePerlin2D67 = snoise( temp_cast_0 );
|
|
simplePerlin2D67 = simplePerlin2D67*0.5 + 0.5;
|
|
float temp_output_1_0_g1 = simplePerlin2D67;
|
|
float sinIn7_g1 = sin( temp_output_1_0_g1 );
|
|
float sinInOffset6_g1 = sin( ( temp_output_1_0_g1 + 1.0 ) );
|
|
float lerpResult20_g1 = lerp( break19_g1.x , break19_g1.y , frac( ( sin( ( ( sinIn7_g1 - sinInOffset6_g1 ) * 91.2228 ) ) * 43758.55 ) ));
|
|
float temp_output_68_0 = ( lerpResult20_g1 + sinIn7_g1 );
|
|
float mulTime6 = _Time.y * _Speed;
|
|
float clampResult9 = clamp( abs( cos( mulTime6 ) ) , _MinAlpha , _MaxAlpha );
|
|
|
|
|
|
finalColor = ( ( temp_output_68_0 * _TintColor ) * clampResult9 );
|
|
return finalColor;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
CustomEditor "ASEMaterialInspector"
|
|
|
|
|
|
}
|
|
/*ASEBEGIN
|
|
Version=18900
|
|
129.6;84;1253;719;2403.896;761.1729;1;True;True
|
|
Node;AmplifyShaderEditor.RangedFloatNode;62;-2959.395,-112.6652;Inherit;False;Property;_RollSpeed;RollSpeed;4;0;Create;True;0;0;0;False;0;False;0;0.6;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleTimeNode;57;-2636.575,-151.4802;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;61;-2578.948,59.71519;Inherit;False;Constant;_Vector0;Vector 0;4;0;Create;True;0;0;0;False;0;False;0,-1;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.RangedFloatNode;63;-2324.981,-380.1801;Inherit;False;Property;_TexScale;TexScale;5;0;Create;True;0;0;0;False;0;False;0;1.5;0;100;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;71;-2348.338,-274.2475;Inherit;False;Constant;_Vector2;Vector 2;7;0;Create;True;0;0;0;False;0;False;24,20;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SinTimeNode;82;-2065.77,-516.9525;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.AbsOpNode;83;-1897.77,-458.9525;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;80;-1924.529,-379.5668;Inherit;False;Constant;_Float1;Float 1;7;0;Create;True;0;0;0;False;0;False;0.01;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-2277.947,-85.28482;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;72;-2086.243,-260.7608;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;81;-1743.036,-462.0915;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;76;-1946.788,-582.7694;Inherit;False;Constant;_Vector3;Vector 3;7;0;Create;True;0;0;0;False;0;False;-1,1;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;55;-1941.233,-159.8152;Inherit;False;0;-1;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.RangedFloatNode;12;-1737.542,507.7756;Inherit;False;Property;_Speed;Speed;0;0;Create;True;0;0;0;False;0;False;1;0.45;0;2;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RotatorNode;75;-1600.111,-580.5786;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SamplerNode;46;-1382.18,-208.6326;Inherit;True;Property;_TextureSample0;Texture Sample 0;3;0;Create;True;0;0;0;False;0;False;-1;None;f7dd883f954da554ea5df874c94e8a31;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleTimeNode;6;-1248.593,353.9346;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.NoiseGeneratorNode;67;-886.6443,-219.9618;Inherit;False;Simplex2D;True;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector2Node;70;-834.4839,37.31929;Inherit;False;Constant;_Vector1;Vector 1;7;0;Create;True;0;0;0;False;0;False;-0.3,0.5;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.CosOpNode;17;-1021.766,421.278;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;65;-615.5557,60.34984;Inherit;False;Property;_TintColor;TintColor;6;1;[HDR];Create;True;0;0;0;False;0;False;0,0,0,0;0.4346614,0.5278031,1.976675,0.7176471;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.FunctionNode;68;-623.6894,-198.4378;Inherit;False;Noise Sine Wave;-1;;1;a6eff29f739ced848846e3b648af87bd;0;2;1;FLOAT;0;False;2;FLOAT2;-0.5,0.5;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.AbsOpNode;18;-820.817,380.3366;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;45;-557.2346,690.9523;Inherit;False;Property;_MaxAlpha;MaxAlpha;2;0;Create;True;0;0;0;False;0;False;1;0.8;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;10;-865.915,749.616;Inherit;False;Property;_MinAlpha;MinAlpha;1;0;Create;True;0;0;0;False;0;False;0.5;0.7;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;64;-294.6604,-107.8432;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ClampOpNode;9;-560.9338,396.588;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;69;-1041.513,26.2324;Inherit;False;Constant;_Float0;Float 0;7;0;Create;True;0;0;0;False;0;False;1.3;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.OneMinusNode;73;-457.7424,-95.5147;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;47;-121.8273,77.95634;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;244.5034,-54.26585;Float;False;True;-1;2;ASEMaterialInspector;100;1;AlphaHuXiCell1;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;0;5;False;-1;10;False;-1;0;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;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;57;0;62;0
|
|
WireConnection;83;0;82;2
|
|
WireConnection;60;0;57;0
|
|
WireConnection;60;1;61;0
|
|
WireConnection;72;0;63;0
|
|
WireConnection;72;1;71;0
|
|
WireConnection;81;0;83;0
|
|
WireConnection;81;1;80;0
|
|
WireConnection;55;0;72;0
|
|
WireConnection;55;1;60;0
|
|
WireConnection;75;0;55;0
|
|
WireConnection;75;1;76;0
|
|
WireConnection;75;2;81;0
|
|
WireConnection;46;1;75;0
|
|
WireConnection;6;0;12;0
|
|
WireConnection;67;0;46;4
|
|
WireConnection;17;0;6;0
|
|
WireConnection;68;1;67;0
|
|
WireConnection;68;2;70;0
|
|
WireConnection;18;0;17;0
|
|
WireConnection;64;0;68;0
|
|
WireConnection;64;1;65;0
|
|
WireConnection;9;0;18;0
|
|
WireConnection;9;1;10;0
|
|
WireConnection;9;2;45;0
|
|
WireConnection;73;0;68;0
|
|
WireConnection;47;0;64;0
|
|
WireConnection;47;1;9;0
|
|
WireConnection;0;0;47;0
|
|
ASEEND*/
|
|
//CHKSM=92FB2AF6530C85A450A64F3530214FA1E80DD10C |