120 lines
4.0 KiB
Plaintext
120 lines
4.0 KiB
Plaintext
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "AX/Add"
|
|
{
|
|
Properties
|
|
{
|
|
_Main_Tex("Main_Tex", 2D) = "white" {}
|
|
[HDR]_Color("Color", Color) = (1,1,1,1)
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
|
|
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
|
|
LOD 100
|
|
|
|
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
|
|
#include "UnityCG.cginc"
|
|
|
|
|
|
struct appdata
|
|
{
|
|
float4 vertex : POSITION;
|
|
float4 color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
};
|
|
|
|
struct v2f
|
|
{
|
|
float4 vertex : SV_POSITION;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
};
|
|
|
|
uniform half4 _Color;
|
|
uniform sampler2D _Main_Tex;
|
|
uniform float4 _Main_Tex_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_texcoord.xy = v.ase_texcoord.xy;
|
|
o.ase_color = v.color;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord.zw = 0;
|
|
float3 vertexValue = float3(0,0,0) ;
|
|
v.vertex.xyz += vertexValue;
|
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
|
return o;
|
|
}
|
|
|
|
fixed4 frag (v2f i ) : SV_Target
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(i);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
|
fixed4 finalColor;
|
|
float2 uv_Main_Tex = i.ase_texcoord.xy * _Main_Tex_ST.xy + _Main_Tex_ST.zw;
|
|
float4 tex2DNode1 = tex2D( _Main_Tex, uv_Main_Tex );
|
|
|
|
|
|
finalColor = ( _Color * tex2DNode1 * i.ase_color * tex2DNode1.a * _Color.a * i.ase_color.a );
|
|
return finalColor;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
CustomEditor "ASEMaterialInspector"
|
|
|
|
|
|
}
|
|
/*ASEBEGIN
|
|
Version=16900
|
|
136;221;1426;720;825;378;1;True;False
|
|
Node;AmplifyShaderEditor.ColorNode;2;-32.5,-227;Half;False;Property;_Color;Color;1;1;[HDR];Create;True;0;0;False;0;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.VertexColorNode;3;-3.5,132;Float;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;1;-119.5,-59;Float;True;Property;_Main_Tex;Main_Tex;0;0;Create;True;0;0;False;0;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;4;314.5,-80;Float;False;6;6;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;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;466,-81;Half;False;True;2;Half;ASEMaterialInspector;0;1;AX/Add;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;0;0;1;True;False;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;0
|
|
WireConnection;4;0;2;0
|
|
WireConnection;4;1;1;0
|
|
WireConnection;4;2;3;0
|
|
WireConnection;4;3;1;4
|
|
WireConnection;4;4;2;4
|
|
WireConnection;4;5;3;4
|
|
WireConnection;0;0;4;0
|
|
ASEEND*/
|
|
//CHKSM=09A1BD4D7CE83B719DDBE5680A62C2140C5A195A |