156 lines
5.9 KiB
Plaintext
156 lines
5.9 KiB
Plaintext
![]() |
// Made with Amplify Shader Editor
|
||
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
||
|
Shader "VFX/VFX_UV1/alpha"
|
||
|
{
|
||
|
Properties
|
||
|
{
|
||
|
[HDR]_Color("Color", Color) = (1,1,1,1)
|
||
|
_Texture("Texture", 2D) = "white" {}
|
||
|
_Mask("Mask", 2D) = "white" {}
|
||
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
||
|
|
||
|
}
|
||
|
|
||
|
SubShader
|
||
|
{
|
||
|
|
||
|
|
||
|
Tags { "RenderType"="Opaque" "Queue"="Transparent" }
|
||
|
LOD 0
|
||
|
|
||
|
CGINCLUDE
|
||
|
#pragma target 3.0
|
||
|
ENDCG
|
||
|
Blend SrcAlpha OneMinusSrcAlpha
|
||
|
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"
|
||
|
#define ASE_NEEDS_FRAG_COLOR
|
||
|
|
||
|
|
||
|
struct appdata
|
||
|
{
|
||
|
float4 vertex : POSITION;
|
||
|
float4 color : COLOR;
|
||
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||
|
float4 ase_texcoord : TEXCOORD0;
|
||
|
float4 ase_texcoord1 : TEXCOORD1;
|
||
|
};
|
||
|
|
||
|
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 _Texture;
|
||
|
uniform half4 _Texture_ST;
|
||
|
uniform half4 _Color;
|
||
|
uniform sampler2D _Mask;
|
||
|
uniform half4 _Mask_ST;
|
||
|
|
||
|
|
||
|
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_texcoord1.zw = v.ase_texcoord1.xy;
|
||
|
o.ase_color = v.color;
|
||
|
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 uv0_Texture = i.ase_texcoord1.xy * _Texture_ST.xy + _Texture_ST.zw;
|
||
|
half2 uv1_Texture = i.ase_texcoord1.zw * _Texture_ST.xy + _Texture_ST.zw;
|
||
|
half2 appendResult5 = (half2(uv1_Texture.x , uv1_Texture.y));
|
||
|
float2 uv_Mask = i.ase_texcoord1.xy * _Mask_ST.xy + _Mask_ST.zw;
|
||
|
|
||
|
|
||
|
finalColor = ( tex2D( _Texture, ( uv0_Texture + appendResult5 ) ) * _Color * i.ase_color * tex2D( _Mask, uv_Mask ) * i.ase_color.a );
|
||
|
return finalColor;
|
||
|
}
|
||
|
ENDCG
|
||
|
}
|
||
|
}
|
||
|
CustomEditor "ASEMaterialInspector"
|
||
|
|
||
|
|
||
|
}
|
||
|
/*ASEBEGIN
|
||
|
Version=18100
|
||
|
2761;287;2117;1066;1302.677;236.1649;1;True;False
|
||
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;8;-1296.005,87.50001;Inherit;True;1;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.DynamicAppendNode;5;-1013.693,112.73;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.TextureCoordinatesNode;11;-1079.936,-195.3594;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.SimpleAddOpNode;9;-735,-2.5;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
||
|
Node;AmplifyShaderEditor.SamplerNode;7;-528.9199,632.3475;Inherit;True;Property;_Mask;Mask;2;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.VertexColorNode;6;-497.5424,416.8152;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||
|
Node;AmplifyShaderEditor.SamplerNode;2;-557,-34.5;Inherit;True;Property;_Texture;Texture;1;0;Create;True;0;0;False;0;False;-1;None;3a7e6dc407a9daf44a93b6aadbdbbcc3;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.ColorNode;4;-552.7625,184.66;Half;False;Property;_Color;Color;0;1;[HDR];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.SimpleMultiplyOpNode;3;-145,141.5;Inherit;False;5;5;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;FLOAT;0;False;1;COLOR;0
|
||
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;62,141;Half;False;True;-1;2;ASEMaterialInspector;0;1;VFX/VFX_UV1/alpha;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;2;5;False;-1;10;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=Opaque=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;5;0;8;1
|
||
|
WireConnection;5;1;8;2
|
||
|
WireConnection;9;0;11;0
|
||
|
WireConnection;9;1;5;0
|
||
|
WireConnection;2;1;9;0
|
||
|
WireConnection;3;0;2;0
|
||
|
WireConnection;3;1;4;0
|
||
|
WireConnection;3;2;6;0
|
||
|
WireConnection;3;3;7;0
|
||
|
WireConnection;3;4;6;4
|
||
|
WireConnection;1;0;3;0
|
||
|
ASEEND*/
|
||
|
//CHKSM=99E254F46EC13E11C6C5A99FCB6B3B7FD270FA54
|