179 lines
6.7 KiB
Plaintext
179 lines
6.7 KiB
Plaintext
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "X1/texie/alpha"
|
|
{
|
|
Properties
|
|
{
|
|
_stencil("stencil", Float) = 0
|
|
_MainTex("MainTex", 2D) = "white" {}
|
|
_highLight("highLight", Range( 0 , 1)) = 0
|
|
_alpha("alpha", Range( 0 , 1)) = 0
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
|
|
|
|
Tags { "RenderType"="TransparentCutout" "Queue"="Transparent+10" }
|
|
LOD 100
|
|
|
|
CGINCLUDE
|
|
#pragma target 3.0
|
|
ENDCG
|
|
Blend SrcAlpha OneMinusSrcAlpha
|
|
AlphaToMask Off
|
|
Cull Off
|
|
ColorMask RGBA
|
|
ZWrite Off
|
|
ZTest Always
|
|
Offset 0 , 0
|
|
Stencil
|
|
{
|
|
Ref [_stencil]
|
|
CompFront Equal
|
|
PassFront Replace
|
|
FailFront Keep
|
|
ZFailFront Keep
|
|
CompBack Always
|
|
PassBack Keep
|
|
FailBack Keep
|
|
ZFailBack Keep
|
|
}
|
|
|
|
|
|
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;
|
|
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;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
uniform float _stencil;
|
|
uniform sampler2D _MainTex;
|
|
uniform float4 _MainTex_ST;
|
|
uniform float _highLight;
|
|
uniform float _alpha;
|
|
|
|
|
|
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_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
|
|
float4 tex2DNode2 = tex2D( _MainTex, uv_MainTex );
|
|
float3 appendResult10 = (float3(tex2DNode2.r , tex2DNode2.g , tex2DNode2.b));
|
|
float3 appendResult12 = (float3(i.ase_color.r , i.ase_color.g , i.ase_color.b));
|
|
float4 appendResult13 = (float4(( appendResult10 * appendResult12 * (1.0 + (_highLight - 0.0) * (8.0 - 1.0) / (1.0 - 0.0)) ) , ( tex2DNode2.a * i.ase_color.a * _alpha )));
|
|
|
|
|
|
finalColor = appendResult13;
|
|
return finalColor;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
CustomEditor "ASEMaterialInspector"
|
|
|
|
|
|
}
|
|
/*ASEBEGIN
|
|
Version=18707
|
|
-36;61;1262;457;1053.127;668.151;1;True;True
|
|
Node;AmplifyShaderEditor.SamplerNode;2;-853.6299,-246.5436;Inherit;True;Property;_MainTex;MainTex;1;0;Create;True;0;0;False;0;False;-1;None;57db8b98d85b5594b923ba4ba4cfabe8;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.VertexColorNode;9;-838.1767,104.2194;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;14;-713.5359,-426.0972;Inherit;False;Property;_highLight;highLight;2;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;12;-551.5361,48.60258;Inherit;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;10;-476.136,-225.6974;Inherit;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;16;-535.1272,233.849;Inherit;False;Property;_alpha;alpha;3;0;Create;True;0;0;False;0;False;0;1;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TFHCRemapNode;15;-399.1272,-426.151;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;1;False;4;FLOAT;8;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;8;-183.2317,52.35324;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;-118.1362,-272.7974;Inherit;False;3;3;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;1;55,244.6;Inherit;False;Property;_stencil;stencil;0;0;Create;True;0;0;True;0;False;0;2;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;13;23.06366,-112.5974;Inherit;False;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;175,-129;Float;False;True;-1;2;ASEMaterialInspector;100;1;X1/texie/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;False;False;False;False;False;False;True;0;False;-1;True;2;False;-1;True;True;True;True;True;0;False;-1;False;False;False;True;True;255;True;1;255;False;-1;255;False;-1;5;False;-1;3;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;7;False;-1;True;True;0;False;-1;0;False;-1;True;2;RenderType=TransparentCutout=RenderType;Queue=Transparent=Queue=10;True;2;0;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;12;0;9;1
|
|
WireConnection;12;1;9;2
|
|
WireConnection;12;2;9;3
|
|
WireConnection;10;0;2;1
|
|
WireConnection;10;1;2;2
|
|
WireConnection;10;2;2;3
|
|
WireConnection;15;0;14;0
|
|
WireConnection;8;0;2;4
|
|
WireConnection;8;1;9;4
|
|
WireConnection;8;2;16;0
|
|
WireConnection;11;0;10;0
|
|
WireConnection;11;1;12;0
|
|
WireConnection;11;2;15;0
|
|
WireConnection;13;0;11;0
|
|
WireConnection;13;3;8;0
|
|
WireConnection;0;0;13;0
|
|
ASEEND*/
|
|
//CHKSM=5675D7F1936B1B741ABB53756221ABC30A633B79 |